Page MenuHomeSoftware Heritage

Jenkins > .tox.py3.lib.python3.7.site-packages.swh.web.tests.admin.test_origin_save::Tests / Python tests / test_add_authorized_origin_url
Failed

TEST RESULT

Run At
May 25 2022, 4:46 PM
Details
client = <django.test.client.Client object at 0x7f45e5335be0> staff_user = <User: admin> def test_add_authorized_origin_url(client, staff_user): authorized_url = "https://scm.adullact.net/anonscm/" assert can_save_origin(authorized_url) == SAVE_REQUEST_PENDING url = reverse( "admin-origin-save-add-authorized-url", url_args={"origin_url": authorized_url} ) > check_not_login(client, url) .tox/py3/lib/python3.7/site-packages/swh/web/tests/admin/test_origin_save.py:51: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/py3/lib/python3.7/site-packages/swh/web/tests/admin/test_origin_save.py:39: in check_not_login resp = check_http_post_response(client, url, status_code=302) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ client = <django.test.client.Client object at 0x7f45e5335be0> url = '/admin/origin/save/authorized_urls/add/https://scm.adullact.net/anonscm//' status_code = 302, content_type = '*/*' request_content_type = 'application/json', data = None, http_origin = None def check_http_post_response( client: Client, url: str, status_code: int, content_type: str = "*/*", request_content_type="application/json", data: Optional[Dict[str, Any]] = None, http_origin: Optional[str] = None, ) -> HttpResponse: """Helper function to check HTTP response for a POST request. Args: client: Django test client url: URL to check response status_code: expected HTTP status code content_type: expected response content type request_content_type: content type of request body data: optional POST data Returns: The HTTP response """ actual_response = client.post( url, data=data, content_type=request_content_type, HTTP_ACCEPT=content_type, HTTP_ORIGIN=http_origin, ) > assert isinstance(actual_response, Response) E assert False E + where False = isinstance(<HttpResponseRedirect status_code=302, "text/html; charset=utf-8", url="/admin/login/?next=/admin/origin/save/authorized_urls/add/https%3A//scm.adullact.net/anonscm//">, Response) .tox/py3/lib/python3.7/site-packages/swh/web/tests/utils.py:103: AssertionError