api_client = <rest_framework.test.APIClient object at 0x7f91c0c32eb8>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f91c0c32f60>
origin_count = 2
@pytest.mark.parametrize("origin_count", [1, 2, 10, 100])
def test_api_origins_scroll(api_client, archive_data, origin_count):
page_result = archive_data.origin_list(limit=10000)
origins = page_result.results
origin_urls = {origin.url for origin in origins}
url = reverse("api-1-origins", query_params={"origin_count": origin_count})
> results = scroll_results(api_client, url)
.tox/py3/lib/python3.7/site-packages/swh/web/tests/api/views/test_origin.py:391:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/web/tests/api/views/utils.py:16: in scroll_results
rv = check_api_get_responses(api_client, url, status_code=200)
.tox/py3/lib/python3.7/site-packages/swh/web/tests/utils.py:121: in check_api_get_responses
api_client, url, status_code, content_type="application/json"
.tox/py3/lib/python3.7/site-packages/swh/web/tests/utils.py:68: in check_http_get_response
content_type=content_type,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <HttpResponse status_code=500, "text/html; charset=utf-8">
status_code = 200, content_type = 'application/json'
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: Traceback (most recent call last):
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/django/core/handlers/base.py", line 143, in _get_response
E response = response.render()
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/django/template/response.py", line 106, in render
E self.content = self.rendered_content
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/rest_framework/response.py", line 70, in rendered_content
E ret = renderer.render(self.data, accepted_media_type, context)
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/rest_framework/renderers.py", line 103, in render
E allow_nan=not self.strict, separators=separators
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/rest_framework/utils/json.py", line 25, in dumps
E return json.dumps(*args, **kwargs)
E File "/usr/lib/python3.7/json/__init__.py", line 238, in dumps
E **kw).encode(obj)
E File "/usr/lib/python3.7/json/encoder.py", line 199, in encode
E chunks = self.iterencode(o, _one_shot=True)
E File "/usr/lib/python3.7/json/encoder.py", line 257, in iterencode
E return _iterencode(o, 0)
E File "/var/lib/jenkins/workspace/DWAPPS/tests-on-diff/.tox/py3/lib/python3.7/site-packages/rest_framework/utils/encoders.py", line 50, in default
E return obj.decode()
E UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb7 in position 3: invalid start byte
E
E assert 500 == 200
E +500
E -200
.tox/py3/lib/python3.7/site-packages/swh/web/tests/utils.py:34: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Sep 28 2021, 7:48 PM