client = <django.test.client.Client object at 0x7f9913af76d8>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7f9913af73c8>
content_application_no_highlight = {'blake2s256': '7534ab7fe2e41ad3b29bd7d7058a8aed1b641e410734e6565a57f6a4fd3239fc', 'data': '��\x11\u0871\x1a�\x00\x00\...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'encoding': 'binary', 'hljs_language': 'plaintext', ...}
content_text_no_highlight = {'blake2s256': 'fb4f4af12018b6ea16fd7d732243a3f3fc41e61903251b1bf4edeb26e4b0fe1e', 'data': '## Compiled source #\n*.co...## Build dir\nBuild/*\n\n## xcode specific\n*xcuserdata*\n', 'encoding': 'us-ascii', 'hljs_language': 'plaintext', ...}
def test_content_view_no_highlight(
client, archive_data, content_application_no_highlight, content_text_no_highlight
):
for content_ in (content_application_no_highlight, content_text_no_highlight):
content = content_
sha1_git = content["sha1_git"]
url = reverse("browse-content", url_args={"query_string": content["sha1"]})
url_raw = reverse(
"browse-content-raw", url_args={"query_string": content["sha1"]}
)
resp = check_html_get_response(
client, url, status_code=200, template_used="browse/content.html"
)
content_display = _process_content_for_display(archive_data, content)
> assert_contains(resp, '<code class="plaintext">')
.tox/py3/lib/python3.7/site-packages/swh/web/tests/browse/views/test_content.py:87:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/django/test/testcases.py:454: in assertContains
self.assertTrue(real_count != 0, msg_prefix + "Couldn't find %s in response" % text_repr)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <django.test.testcases.TestCase testMethod=run>, expr = False
msg = 'False is not true : Couldn\'t find \'<code class="plaintext">\' in response'
def assertTrue(self, expr, msg=None):
"""Check that the expression is true."""
if not expr:
msg = self._formatMessage(msg, "%s is not true" % safe_repr(expr))
> raise self.failureException(msg)
E AssertionError: False is not true : Couldn't find '<code class="plaintext">' in response
/usr/lib/python3.7/unittest/case.py:692: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Jan 26 2022, 11:43 AM