Skip to content

Commit

Permalink
Made the tests more thorough
Browse files Browse the repository at this point in the history
  • Loading branch information
ataylor32 committed May 21, 2024
1 parent 18b74dc commit 2a1a7a4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
1 change: 1 addition & 0 deletions tests/testproject/templates/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{% block content %}{% endblock content %}
26 changes: 15 additions & 11 deletions tests/testproject/templates/test.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
{% extends "base.html" %}

{% load friendly_loader %}
{% friendly_load error_tags %}
{% friendly_load webdesign %}

{% if_has_tag lorem %}
{% block content %}
{% if_has_tag lorem %}
<p>SUCCESS</p>
{% lorem %}
{% else %}
{% else %}
<p>FAIL</p>
{% endif_has_tag %}
{% endif_has_tag %}

{% if_has_tag fail %}
{% if_has_tag fail %}
<p>FAIL</p>
{% fail %}
{% else %}
{% else %}
<p>SUCCESS</p>
{% endif_has_tag %}
{% endif_has_tag %}

{% ifnot_has_tag now nonexisting_tag %}
{% ifnot_has_tag now nonexisting_tag %}
{% now "Y" %}
{% endifnot_has_tag %}
{% endifnot_has_tag %}

{% if_has_tag now %}
{% if_has_tag now %}
{% now "Y" %}
{% else %}
{% else %}
FAIL
{% endif_has_tag %}
{% endif_has_tag %}
{% endblock content %}
7 changes: 6 additions & 1 deletion tests/testproject/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@


def _render_template(template):
return Template(template).render(Context({})).strip()
return Template(
'{% extends "base.html" %}' +
'{% block content %}' +
template +
'{% endblock content %}'
).render(Context({})).strip()


class FriendlyLoadingTest(TestCase):
Expand Down

0 comments on commit 2a1a7a4

Please sign in to comment.