api_client = <rest_framework.test.APIClient object at 0x7fdbe40c1ac8>
client = <django.test.client.Client object at 0x7fdbe40c1a20>
@given(origin(), content(), directory(), release(), revision(), snapshot())
> def test_swhid_resolve_success(
api_client, client, origin, content, directory, release, revision, snapshot
):
.tox/py3/lib/python3.7/site-packages/swh/web/tests/api/views/test_identifiers.py:29:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/web/tests/api/views/test_identifiers.py:44: in test_swhid_resolve_success
resp = check_api_get_responses(api_client, url, status_code=200)
.tox/py3/lib/python3.7/site-packages/swh/web/tests/utils.py:119: 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:66: 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 67, in default
E return super().default(obj)
E File "/usr/lib/python3.7/json/encoder.py", line 179, in default
E raise TypeError(f'Object of type {o.__class__.__name__} '
E TypeError: Object of type ObjectType is not JSON serializable
E
E assert 500 == 200
E +500
E -200
.tox/py3/lib/python3.7/site-packages/swh/web/tests/utils.py:32: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Mar 3 2021, 10:02 AM