Page MenuHomeSoftware Heritage
Paste P1527

(An Untitled Masterwork)
ActivePublic

Authored by vlorentz on Nov 14 2022, 12:38 PM.
client = <django.test.client.Client object at 0x7faac8648eb0>
def test_vault_view(client):
url = reverse("vault")
> check_html_get_response(client, url, status_code=200, template_used="vault-ui.html")
.tox/py3/lib/python3.9/site-packages/swh/web/vault/tests/test_views.py:12:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.9/site-packages/swh/web/tests/helpers.py:230: in check_html_get_response
response = check_http_get_response(
.tox/py3/lib/python3.9/site-packages/swh/web/tests/helpers.py:61: in check_http_get_response
return _assert_http_response(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <HttpResponse status_code=500, "text/html; charset=utf-8">, status_code = 200, content_type = 'text/html'
def _assert_http_response(
response: HttpResponseBase, status_code: int, content_type: str
) -> HttpResponseBase:
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)
elif isinstance(response, HttpResponse):
error_context = getattr(response, "traceback", response.content)
> assert response.status_code == status_code, error_context
E AssertionError: Traceback (most recent call last):
E File &quot;/home/dev/swh-environment/swh-web/.tox/py3/lib/python3.9/site-packages/django/core/handlers/base.py&quot;, line 113, in _get_response
E response = wrapped_callback(request, *callback_args, **callback_kwargs)
E File &quot;/home/dev/swh-environment/swh-web/.tox/py3/lib/python3.9/site-packages/swh/web/vault/urls.py&quot;, line 15, in vault_view
E return render(
E File &quot;/home/dev/swh-environment/swh-web/.tox/py3/lib/python3.9/site-packages/django/shortcuts.py&quot;, line 36, in render
E content = loader.render_to_string(template_name, context, request, using=using)
E File &quot;/home/dev/swh-environment/swh-web/.tox/py3/lib/python3.9/site-packages/django/template/loader.py&quot;, line 62, in render_to_string
E return template.render(context, request)
E File &quot;/home/dev/swh-environment/swh-web/.tox/py3/lib/python3.9/site-packages/django/template/backends/django.py&quot;, line 61, in render
E return self.template.render(context)
E File &quot;/home/dev/swh-environment/swh-web/.tox/py3/lib/python3.9/site-packages/django/template/base.py&quot;, line 171, in render
E return self._render(context)
E File &quot;/home/dev/swh-environment/swh-web/.tox/py3/lib/python3.9/site-packages/django/test/utils.py&quot;, line 96, in instrumented_test_render
E return self.nodelist.render(context)
E File &quot;/home/dev/swh-environment/swh-web/.tox/py3/lib/python3.9/site-packages/django/template/base.py&quot;, line 937, in render
E bit = node.render_annotated(context)
E File &quot;/home/dev/swh-environment/swh-web/.tox/py3/lib/python3.9/site-packages/django/template/base.py&quot;, line 904, in render_annotated
E return self.render(context)
E File &quot;/home/dev/swh-environment/swh-web/.tox/py3/lib/python3.9/site-packages/django/template/loader_tags.py&quot;, line 150, in render
E return compiled_parent._render(context)
E File &quot;/home/dev/swh-environment/swh-web/.tox/py3/lib/python3.9/site-packages/django/test/utils.py&quot;, line 96, in instrumented_test_render
E return self.nodelist.render(context)
E File &quot;/home/dev/swh-environment/swh-web/.tox/py3/lib/python3.9/site-packages/django/template/base.py&quot;, line 937, in render
E bit = node.render_annotated(context)
E File &quot;/home/dev/swh-environment/swh-web/.tox/py3/lib/python3.9/site-packages/django/template/base.py&quot;, line 904, in render_annotated
E return self.render(context)
E File &quot;/home/dev/swh-environment/swh-web/.tox/py3/lib/python3.9/site-packages/django/template/loader_tags.py&quot;, line 150, in render
E return compiled_parent._render(context)
E File &quot;/home/dev/swh-environment/swh-web/.tox/py3/lib/python3.9/site-packages/django/test/utils.py&quot;, line 96, in instrumented_test_render
E return self.nodelist.render(context)
E File &quot;/home/dev/swh-environment/swh-web/.tox/py3/lib/python3.9/site-packages/django/template/base.py&quot;, line 937, in render
E bit = node.render_annotated(context)
E File &quot;/home/dev/swh-environment/swh-web/.tox/py3/lib/python3.9/site-packages/django/template/base.py&quot;, line 904, in render_annotated
E return self.render(context)
E File &quot;/home/dev/swh-environment/swh-web/.tox/py3/lib/python3.9/site-packages/django/template/loader_tags.py&quot;, line 62, in render
E result = block.nodelist.render(context)
E File &quot;/home/dev/swh-environment/swh-web/.tox/py3/lib/python3.9/site-packages/django/template/base.py&quot;, line 937, in render
E bit = node.render_annotated(context)
E File &quot;/home/dev/swh-environment/swh-web/.tox/py3/lib/python3.9/site-packages/django/template/base.py&quot;, line 904, in render_annotated
E return self.render(context)
E File &quot;/home/dev/swh-environment/swh-web/.tox/py3/lib/python3.9/site-packages/django/template/library.py&quot;, line 192, in render
E output = self.func(*resolved_args, **resolved_kwargs)
E File &quot;/home/dev/swh-environment/swh-web/.tox/py3/lib/python3.9/site-packages/webpack_loader/templatetags/webpack_loader.py&quot;, line 22, in render_bundle
E tags = utils.get_as_tags(
E File &quot;/home/dev/swh-environment/swh-web/.tox/py3/lib/python3.9/site-packages/webpack_loader/utils.py&quot;, line 71, in get_as_tags
E bundle = _get_bundle(loader, bundle_name, extension)
E File &quot;/home/dev/swh-environment/swh-web/.tox/py3/lib/python3.9/site-packages/webpack_loader/utils.py&quot;, line 47, in _get_bundle
E bundle = loader.get_bundle(bundle_name)
E File &quot;/home/dev/swh-environment/swh-web/.tox/py3/lib/python3.9/site-packages/webpack_loader/loader.py&quot;, line 114, in get_bundle
E raise WebpackBundleLookupError(&#39;Cannot resolve bundle {0}.&#39;.format(bundle_name))
E webpack_loader.exceptions.WebpackBundleLookupError: Cannot resolve bundle save_code_now.
E
E assert 500 == 200
E + where 500 = <HttpResponse status_code=500, "text/html; charset=utf-8">.status_code
.tox/py3/lib/python3.9/site-packages/swh/web/tests/helpers.py:35: AssertionError