-
-
Notifications
You must be signed in to change notification settings - Fork 153
Expand file tree
/
Copy pathtests.py
More file actions
70 lines (46 loc) · 2.22 KB
/
Copy pathtests.py
File metadata and controls
70 lines (46 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
from django.template import engines
from django.utils.safestring import mark_safe
from main.templatetags.htmltruncate import truncatewords_html_preserve_pre
def test_truncatewords_html_preserve_pre_keeps_pre_newlines():
html = mark_safe(
'<p>Intro</p><pre><code>line one\nline two\nline three</code></pre>'
)
out = truncatewords_html_preserve_pre(html, 50)
assert 'line one\nline two' in out
assert 'line one line two line three' not in out
engine = engines['django']
t = engine.from_string('{{ x|truncatewords_html_preserve_pre:50 }}')
rendered = t.render({'x': html})
assert 'line one\nline two' in rendered
def test_index(client, arches, repos, package, groups, staff_groups):
response = client.get('/')
assert response.status_code == 200
def test_about(client, arches, repos, package, groups, staff_groups):
response = client.get('/about/')
assert response.status_code == 200
def test_art(client, arches, repos, package, groups, staff_groups):
response = client.get('/art/')
assert response.status_code == 200
def test_donate(client, arches, repos, package, groups, staff_groups):
response = client.get('/donate/')
assert response.status_code == 200
def test_download(client, arches, repos, package, groups, staff_groups):
response = client.get('/download/')
assert response.status_code == 200
def test_master_keys(client, arches, repos, package, groups, staff_groups):
response = client.get('/master-keys/')
assert response.status_code == 200
def test_master_keys_json(client, arches, repos, package, groups, staff_groups):
response = client.get('/master-keys/json/')
assert response.status_code == 200
def test_feeds(client, arches, repos, package, groups, staff_groups):
response = client.get('/feeds/')
assert response.status_code == 200
def test_people(client, arches, repos, package, groups, staff_groups):
response = client.get('/people/developers/')
assert response.status_code == 200
def test_sitemap(client, arches, repos, package, groups, staff_groups):
sitemaps = ['sitemap', 'sitemap-base']
for sitemap in sitemaps:
response = client.get(f'/{sitemap}.xml')
assert response.status_code == 200