client = <django.test.client.Client object at 0x7f926169ed30>
staff_user = <User: admin>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f9261069278>
object_type = 'content'
@pytest.mark.django_db
> @pytest.mark.parametrize("object_type", ["content", "directory"])
@given(new_origin())
def test_browse_origin_content_directory_empty_snapshot(
client, staff_user, archive_data, object_type, new_origin
):
.tox/py3/lib/python3.7/site-packages/swh/web/tests/browse/views/test_origin.py:587:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/web/tests/browse/views/test_origin.py:604: in test_browse_origin_content_directory_empty_snapshot
client, url, status_code=200, template_used=f"browse/{object_type}.html"
.tox/py3/lib/python3.7/site-packages/swh/web/tests/utils.py:207: in check_html_get_response
client, url, status_code, content_type="text/html"
.tox/py3/lib/python3.7/site-packages/swh/web/tests/utils.py:68: in check_http_get_response
content_type=content_type,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <HttpResponsePermanentRedirect status_code=301, "text/html; charset=utf-8", url="/browse/content/?origin_url=git://a.0&path=baz">
status_code = 200, content_type = 'text/html'
def _assert_http_response(
response: HttpResponse, status_code: int, content_type: str
) -> HttpResponse:
if isinstance(response, Response):
drf_response = cast(Response, response)
error_context = (
drf_response.data.pop("traceback")
if isinstance(drf_response.data, dict) and "traceback" in drf_response.data
else drf_response.data
)
elif isinstance(response, StreamingHttpResponse):
error_context = getattr(response, "traceback", response.streaming_content)
else:
error_context = getattr(response, "traceback", response.content)
> assert response.status_code == status_code, error_context
E AssertionError: b''
E assert 301 == 200
E +301
E -200
.tox/py3/lib/python3.7/site-packages/swh/web/tests/utils.py:34: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Nov 5 2021, 1:47 PM