Skip to content

Commit be3ae39

Browse files
committed
Add another template test for 2nd snippet in README
1 parent 714935a commit be3ae39

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

tests/test_templates.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from django.template import Context, Template
44

5-
template = """
5+
readme_template = """
66
{% load static %}
77
<head>
88
<link rel="stylesheet" href="{% static 'bootstrap/css/bootstrap.min.css' %}">
@@ -15,19 +15,35 @@
1515
</body>
1616
"""
1717

18+
classic_template = """
19+
{% load static %}
20+
<link rel="stylesheet" href="{% static 'fontawesome/css/all.min.css' %}">
21+
"""
22+
1823

19-
def test_template():
24+
def test_readme_template():
2025
"""Importing the package should work as described in the README."""
2126
bootstrap_min_css = "bootstrap/css/bootstrap.min.css"
2227
bootstrap_min_js = "bootstrap/js/bootstrap.bundle.min.js"
2328
fontawesome_min_js = "fontawesome/js/all.min.js"
2429
jquery_min_js = "bootstrap/js/jquery.min.js"
2530

2631
c = Context()
27-
t = Template(template)
32+
t = Template(readme_template)
2833
html = t.render(c)
2934

3035
assert f'<link rel="stylesheet" href="/static/{bootstrap_min_css}">' in html
3136
assert f'<script defer src="/static/{fontawesome_min_js}"></script>' in html
3237
assert f'<script src="/static/{jquery_min_js}"></script>' in html
3338
assert f'<script src="/static/{bootstrap_min_js}"></script>' in html
39+
40+
41+
def test_classic_fontawesome():
42+
"""Non-JS powered, classic Font Awesome."""
43+
fontawesome_min_css = "fontawesome/css/all.min.css"
44+
45+
c = Context()
46+
t = Template(classic_template)
47+
html = t.render(c)
48+
49+
assert f'<link rel="stylesheet" href="/static/{fontawesome_min_css}">' in html

0 commit comments

Comments
 (0)