Changeset View
Changeset View
Standalone View
Standalone View
swh/web/tests/browse/views/test_origin.py
Show First 20 Lines • Show All 558 Lines • ▼ Show 20 Lines | url = reverse('browse-origin-content', | ||||
url_args=url_args, | url_args=url_args, | ||||
query_params=query_params) | query_params=query_params) | ||||
resp = client.get(url) | resp = client.get(url) | ||||
assert resp.status_code == 200 | assert resp.status_code == 200 | ||||
assert_template_used(resp, 'browse/content.html') | assert_template_used(resp, 'browse/content.html') | ||||
assert type(content['data']) == str | |||||
assert_contains(resp, '<code class="%s">' % | assert_contains(resp, '<code class="%s">' % | ||||
content['hljs_language']) | content['hljs_language']) | ||||
assert_contains(resp, escape(content['data'])) | assert_contains(resp, escape(content['data'])) | ||||
split_path = content_path.split('/') | split_path = content_path.split('/') | ||||
filename = split_path[-1] | filename = split_path[-1] | ||||
path = content_path.replace(filename, '')[:-1] | path = content_path.replace(filename, '')[:-1] | ||||
▲ Show 20 Lines • Show All 328 Lines • Show Last 20 Lines |