api_client = <rest_framework.test.APIClient object at 0x7f5e6addcb38>
mailmap_user = <User: johndoe>
@pytest.mark.django_db(transaction=True)
def test_mailmap_endpoints_error_response(api_client, mailmap_user):
api_client.force_login(mailmap_user)
for view_name in ("profile-mailmap-add", "profile-mailmap-update"):
url = reverse(view_name)
> resp = check_api_post_response(api_client, url, status_code=500)
.tox/py3/lib/python3.7/site-packages/swh/web/tests/auth/test_mailmap.py:53:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/web/tests/utils.py:158: in check_api_post_response
content_type=content_type,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <HttpResponseBadRequest status_code=400, "text/html; charset=utf-8">
status_code = 500, content_type = '*/*'
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'Missing from_email value'
E assert 400 == 500
E +400
E -500
.tox/py3/lib/python3.7/site-packages/swh/web/tests/utils.py:34: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Feb 5 2022, 1:12 AM