Skip to content

Commit

Permalink
Move tests into separate top-level directory
Browse files Browse the repository at this point in the history
  • Loading branch information
j4mie committed Feb 14, 2020
1 parent 739d888 commit 07e122f
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 7 deletions.
2 changes: 1 addition & 1 deletion manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "wrapwith.tests.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.settings")

from django.core.management import execute_from_command_line

Expand Down
4 changes: 2 additions & 2 deletions scripts/check
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh -e

flake8 wrapwith
isort --check --diff --recursive wrapwith
black --check --diff wrapwith
isort --check --diff --recursive wrapwith tests
black --check --diff wrapwith tests
6 changes: 3 additions & 3 deletions scripts/lint
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh -e

autoflake --in-place --recursive wrapwith
isort --recursive wrapwith
black wrapwith
autoflake --in-place --recursive wrapwith tests
isort --recursive wrapwith tests
black wrapwith tests
File renamed without changes.
2 changes: 1 addition & 1 deletion wrapwith/tests/settings.py → tests/settings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
INSTALLED_APPS = [
"wrapwith",
"wrapwith.tests",
"tests",
]

TEMPLATES = [
Expand Down
File renamed without changes.
11 changes: 11 additions & 0 deletions tests/templates/nested.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{% load wrapwith %}

{% wrapwith "wrappers/divwitharg.html" with class="outer" %}
hello!
{% wrapwith "wrappers/divwitharg.html" with class="inner1" %}
inner1
{% endwrapwith %}
{% wrapwith "wrappers/divwitharg.html" with class="inner2" %}
inner2
{% endwrapwith %}
{% endwrapwith %}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 17 additions & 0 deletions wrapwith/tests/tests.py → tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,20 @@ def test_arguments(self):
def test_only(self):
rendered = render_to_string("only.html")
self.assertHTMLEqual(rendered, "<div class='arg'>hello!</div>")

def test_nested(self):
rendered = render_to_string("nested.html")
self.assertHTMLEqual(
rendered,
"""
<div class="outer">
hello!
<div class="inner1">
inner1
</div>
<div class="inner2">
inner2
</div>
</div>
""",
)

0 comments on commit 07e122f

Please sign in to comment.