summaryrefslogtreecommitdiff
path: root/tests/template_tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/template_tests')
-rw-r--r--tests/template_tests/alternate_urls.py1
-rw-r--r--tests/template_tests/filter_tests/test_autoescape.py2
-rw-r--r--tests/template_tests/filter_tests/test_date.py2
-rw-r--r--tests/template_tests/filter_tests/test_time.py2
-rw-r--r--tests/template_tests/filter_tests/test_timesince.py2
-rw-r--r--tests/template_tests/filter_tests/test_timeuntil.py2
-rw-r--r--tests/template_tests/syntax_tests/test_autoescape.py2
-rw-r--r--tests/template_tests/syntax_tests/test_basic.py3
-rw-r--r--tests/template_tests/syntax_tests/test_exceptions.py2
-rw-r--r--tests/template_tests/syntax_tests/test_extends.py1
-rw-r--r--tests/template_tests/syntax_tests/test_filter_syntax.py2
-rw-r--r--tests/template_tests/syntax_tests/test_if.py4
-rw-r--r--tests/template_tests/syntax_tests/test_include.py3
-rw-r--r--tests/template_tests/syntax_tests/test_numpy.py2
-rw-r--r--tests/template_tests/syntax_tests/test_ssi.py6
-rw-r--r--tests/template_tests/syntax_tests/test_static.py2
-rw-r--r--tests/template_tests/syntax_tests/test_url.py2
-rw-r--r--tests/template_tests/templatetags/bad_tag.py1
-rw-r--r--tests/template_tests/templatetags/inclusion.py1
-rw-r--r--tests/template_tests/test_context.py4
-rw-r--r--tests/template_tests/test_loaders.py18
-rw-r--r--tests/template_tests/test_parser.py4
-rw-r--r--tests/template_tests/test_response.py12
-rw-r--r--tests/template_tests/test_unicode.py4
-rw-r--r--tests/template_tests/tests.py13
-rw-r--r--tests/template_tests/urls.py2
-rw-r--r--tests/template_tests/utils.py3
27 files changed, 52 insertions, 50 deletions
diff --git a/tests/template_tests/alternate_urls.py b/tests/template_tests/alternate_urls.py
index 9b05aa619b..cb73513879 100644
--- a/tests/template_tests/alternate_urls.py
+++ b/tests/template_tests/alternate_urls.py
@@ -2,7 +2,6 @@ from django.conf.urls import url
from . import views
-
urlpatterns = [
# View returning a template response
url(r'^template_response_view/$', views.template_response_view),
diff --git a/tests/template_tests/filter_tests/test_autoescape.py b/tests/template_tests/filter_tests/test_autoescape.py
index 793fbf80d6..35faada9c6 100644
--- a/tests/template_tests/filter_tests/test_autoescape.py
+++ b/tests/template_tests/filter_tests/test_autoescape.py
@@ -1,6 +1,6 @@
from django.test import SimpleTestCase
-from ..utils import setup, SafeClass, UnsafeClass
+from ..utils import SafeClass, UnsafeClass, setup
class AutoescapeStringfilterTests(SimpleTestCase):
diff --git a/tests/template_tests/filter_tests/test_date.py b/tests/template_tests/filter_tests/test_date.py
index 8485e10a19..612742a501 100644
--- a/tests/template_tests/filter_tests/test_date.py
+++ b/tests/template_tests/filter_tests/test_date.py
@@ -4,8 +4,8 @@ from django.template.defaultfilters import date
from django.test import SimpleTestCase
from django.utils import timezone
-from .timezone_utils import TimezoneTestCase
from ..utils import setup
+from .timezone_utils import TimezoneTestCase
class DateTests(TimezoneTestCase):
diff --git a/tests/template_tests/filter_tests/test_time.py b/tests/template_tests/filter_tests/test_time.py
index e2b47b45b4..f5dc47813e 100644
--- a/tests/template_tests/filter_tests/test_time.py
+++ b/tests/template_tests/filter_tests/test_time.py
@@ -4,8 +4,8 @@ from django.template.defaultfilters import time as time_filter
from django.test import SimpleTestCase
from django.utils import timezone
-from .timezone_utils import TimezoneTestCase
from ..utils import setup
+from .timezone_utils import TimezoneTestCase
class TimeTests(TimezoneTestCase):
diff --git a/tests/template_tests/filter_tests/test_timesince.py b/tests/template_tests/filter_tests/test_timesince.py
index e10e86e921..52901cea36 100644
--- a/tests/template_tests/filter_tests/test_timesince.py
+++ b/tests/template_tests/filter_tests/test_timesince.py
@@ -6,8 +6,8 @@ from django.template.defaultfilters import timesince_filter
from django.test import SimpleTestCase
from django.test.utils import requires_tz_support
-from .timezone_utils import TimezoneTestCase
from ..utils import setup
+from .timezone_utils import TimezoneTestCase
class TimesinceTests(TimezoneTestCase):
diff --git a/tests/template_tests/filter_tests/test_timeuntil.py b/tests/template_tests/filter_tests/test_timeuntil.py
index 822a7ea9eb..5befabb379 100644
--- a/tests/template_tests/filter_tests/test_timeuntil.py
+++ b/tests/template_tests/filter_tests/test_timeuntil.py
@@ -6,8 +6,8 @@ from django.template.defaultfilters import timeuntil_filter
from django.test import SimpleTestCase
from django.test.utils import requires_tz_support
-from .timezone_utils import TimezoneTestCase
from ..utils import setup
+from .timezone_utils import TimezoneTestCase
class TimeuntilTests(TimezoneTestCase):
diff --git a/tests/template_tests/syntax_tests/test_autoescape.py b/tests/template_tests/syntax_tests/test_autoescape.py
index 7b5c12c59c..d58dfc9176 100644
--- a/tests/template_tests/syntax_tests/test_autoescape.py
+++ b/tests/template_tests/syntax_tests/test_autoescape.py
@@ -2,7 +2,7 @@ from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
-from ..utils import setup, SafeClass, UnsafeClass
+from ..utils import SafeClass, UnsafeClass, setup
class AutoescapeTagTests(SimpleTestCase):
diff --git a/tests/template_tests/syntax_tests/test_basic.py b/tests/template_tests/syntax_tests/test_basic.py
index 073d26e10b..741b3ace8f 100644
--- a/tests/template_tests/syntax_tests/test_basic.py
+++ b/tests/template_tests/syntax_tests/test_basic.py
@@ -1,8 +1,7 @@
from django.template.base import Context, TemplateSyntaxError
from django.test import SimpleTestCase
-from ..utils import setup, SilentGetItemClass, SilentAttrClass, SomeClass
-
+from ..utils import SilentAttrClass, SilentGetItemClass, SomeClass, setup
basic_templates = {
'basic-syntax01': 'something cool',
diff --git a/tests/template_tests/syntax_tests/test_exceptions.py b/tests/template_tests/syntax_tests/test_exceptions.py
index e3645cb13f..db1e0f9f5f 100644
--- a/tests/template_tests/syntax_tests/test_exceptions.py
+++ b/tests/template_tests/syntax_tests/test_exceptions.py
@@ -1,8 +1,8 @@
from django.template import TemplateDoesNotExist, TemplateSyntaxError
from django.test import SimpleTestCase
-from .test_extends import inheritance_templates
from ..utils import setup
+from .test_extends import inheritance_templates
class ExceptionsTests(SimpleTestCase):
diff --git a/tests/template_tests/syntax_tests/test_extends.py b/tests/template_tests/syntax_tests/test_extends.py
index 3ad19616af..1b0ff36a3c 100644
--- a/tests/template_tests/syntax_tests/test_extends.py
+++ b/tests/template_tests/syntax_tests/test_extends.py
@@ -2,7 +2,6 @@ from django.test import SimpleTestCase
from ..utils import setup
-
inheritance_templates = {
'inheritance01': "1{% block first %}&{% endblock %}3{% block second %}_{% endblock %}",
'inheritance02': "{% extends 'inheritance01' %}"
diff --git a/tests/template_tests/syntax_tests/test_filter_syntax.py b/tests/template_tests/syntax_tests/test_filter_syntax.py
index 94e7fe2871..1793fc67de 100644
--- a/tests/template_tests/syntax_tests/test_filter_syntax.py
+++ b/tests/template_tests/syntax_tests/test_filter_syntax.py
@@ -4,7 +4,7 @@ from __future__ import unicode_literals
from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
-from ..utils import setup, SomeClass, SomeOtherException, UTF8Class
+from ..utils import SomeClass, SomeOtherException, UTF8Class, setup
class FilterSyntaxTests(SimpleTestCase):
diff --git a/tests/template_tests/syntax_tests/test_if.py b/tests/template_tests/syntax_tests/test_if.py
index 9f207c4114..290a092a04 100644
--- a/tests/template_tests/syntax_tests/test_if.py
+++ b/tests/template_tests/syntax_tests/test_if.py
@@ -1,11 +1,11 @@
import warnings
from django.template import TemplateSyntaxError
-from django.test import ignore_warnings, SimpleTestCase
+from django.test import SimpleTestCase, ignore_warnings
from django.test.utils import reset_warning_registry
from django.utils.deprecation import RemovedInDjango20Warning
-from ..utils import setup, TestObj
+from ..utils import TestObj, setup
class IfTagTests(SimpleTestCase):
diff --git a/tests/template_tests/syntax_tests/test_include.py b/tests/template_tests/syntax_tests/test_include.py
index 7f3adfd8fe..17ad9c1e4c 100644
--- a/tests/template_tests/syntax_tests/test_include.py
+++ b/tests/template_tests/syntax_tests/test_include.py
@@ -1,9 +1,8 @@
from django.template import Context, TemplateDoesNotExist, TemplateSyntaxError
from django.test import SimpleTestCase
-from .test_basic import basic_templates
from ..utils import setup
-
+from .test_basic import basic_templates
include_fail_templates = {
'include-fail1': '{% load bad_tag %}{% badtag %}',
diff --git a/tests/template_tests/syntax_tests/test_numpy.py b/tests/template_tests/syntax_tests/test_numpy.py
index dd6c01f976..822b10fd7a 100644
--- a/tests/template_tests/syntax_tests/test_numpy.py
+++ b/tests/template_tests/syntax_tests/test_numpy.py
@@ -1,5 +1,5 @@
-from unittest import skipIf
import warnings
+from unittest import skipIf
from django.test import SimpleTestCase
diff --git a/tests/template_tests/syntax_tests/test_ssi.py b/tests/template_tests/syntax_tests/test_ssi.py
index b87c1f9c2c..b000dd6583 100644
--- a/tests/template_tests/syntax_tests/test_ssi.py
+++ b/tests/template_tests/syntax_tests/test_ssi.py
@@ -1,7 +1,9 @@
import os
-from django.test import ignore_warnings, SimpleTestCase
-from django.utils.deprecation import RemovedInDjango19Warning, RemovedInDjango20Warning
+from django.test import SimpleTestCase, ignore_warnings
+from django.utils.deprecation import (
+ RemovedInDjango19Warning, RemovedInDjango20Warning,
+)
from ..utils import ROOT, setup
diff --git a/tests/template_tests/syntax_tests/test_static.py b/tests/template_tests/syntax_tests/test_static.py
index 19b4e53cde..b646ac2bb8 100644
--- a/tests/template_tests/syntax_tests/test_static.py
+++ b/tests/template_tests/syntax_tests/test_static.py
@@ -1,5 +1,5 @@
from django.conf import settings
-from django.test import override_settings, SimpleTestCase
+from django.test import SimpleTestCase, override_settings
from django.utils.six.moves.urllib.parse import urljoin
from ..utils import setup
diff --git a/tests/template_tests/syntax_tests/test_url.py b/tests/template_tests/syntax_tests/test_url.py
index 60f777f6d0..8da4dba67b 100644
--- a/tests/template_tests/syntax_tests/test_url.py
+++ b/tests/template_tests/syntax_tests/test_url.py
@@ -1,7 +1,7 @@
# coding: utf-8
from django.core.urlresolvers import NoReverseMatch
from django.template import TemplateSyntaxError
-from django.test import ignore_warnings, override_settings, SimpleTestCase
+from django.test import SimpleTestCase, ignore_warnings, override_settings
from django.utils.deprecation import RemovedInDjango20Warning
from ..utils import setup
diff --git a/tests/template_tests/templatetags/bad_tag.py b/tests/template_tests/templatetags/bad_tag.py
index b806423df3..a5be15633b 100644
--- a/tests/template_tests/templatetags/bad_tag.py
+++ b/tests/template_tests/templatetags/bad_tag.py
@@ -1,6 +1,5 @@
from django import template
-
register = template.Library()
diff --git a/tests/template_tests/templatetags/inclusion.py b/tests/template_tests/templatetags/inclusion.py
index e4edb264aa..77c9abeb5c 100644
--- a/tests/template_tests/templatetags/inclusion.py
+++ b/tests/template_tests/templatetags/inclusion.py
@@ -4,7 +4,6 @@ from django.template import Library
from django.template.loader import get_template
from django.utils import six
-
register = Library()
diff --git a/tests/template_tests/test_context.py b/tests/template_tests/test_context.py
index 24d589fb25..c7cd70ef6f 100644
--- a/tests/template_tests/test_context.py
+++ b/tests/template_tests/test_context.py
@@ -3,7 +3,9 @@
from unittest import TestCase
from django.http import HttpRequest
-from django.template import Context, RequestContext, Variable, VariableDoesNotExist
+from django.template import (
+ Context, RequestContext, Variable, VariableDoesNotExist,
+)
from django.template.context import RenderContext
diff --git a/tests/template_tests/test_loaders.py b/tests/template_tests/test_loaders.py
index 735dbac87a..e8f5298851 100644
--- a/tests/template_tests/test_loaders.py
+++ b/tests/template_tests/test_loaders.py
@@ -9,22 +9,20 @@ import sys
import types
import unittest
-try:
- import pkg_resources
-except ImportError:
- pkg_resources = None
-
-
-from django.template import TemplateDoesNotExist, Context
-from django.template.loaders import cached, eggs
+from django.template import Context, TemplateDoesNotExist, loader
from django.template.engine import Engine
-from django.template import loader
+from django.template.loaders import cached, eggs
from django.test import SimpleTestCase, ignore_warnings, override_settings
from django.utils import six
-from django.utils.deprecation import RemovedInDjango20Warning
from django.utils._os import upath
+from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.six import StringIO
+try:
+ import pkg_resources
+except ImportError:
+ pkg_resources = None
+
TEMPLATES_DIR = os.path.join(os.path.dirname(upath(__file__)), 'templates')
diff --git a/tests/template_tests/test_parser.py b/tests/template_tests/test_parser.py
index 348428513b..1e1d76b1bd 100644
--- a/tests/template_tests/test_parser.py
+++ b/tests/template_tests/test_parser.py
@@ -6,7 +6,9 @@ from __future__ import unicode_literals
from unittest import TestCase
from django.template import Library, Template, TemplateSyntaxError
-from django.template.base import FilterExpression, Parser, TokenParser, Variable
+from django.template.base import (
+ FilterExpression, Parser, TokenParser, Variable,
+)
from django.test import override_settings
from django.utils import six
diff --git a/tests/template_tests/test_response.py b/tests/template_tests/test_response.py
index 3807789e63..af516e90be 100644
--- a/tests/template_tests/test_response.py
+++ b/tests/template_tests/test_response.py
@@ -1,16 +1,18 @@
from __future__ import unicode_literals
-from datetime import datetime
import os
import pickle
import time
+from datetime import datetime
-from django.test import RequestFactory, SimpleTestCase
from django.conf import settings
from django.template import Context, engines
-from django.template.response import (TemplateResponse, SimpleTemplateResponse,
- ContentNotRenderedError)
-from django.test import ignore_warnings, override_settings
+from django.template.response import (
+ ContentNotRenderedError, SimpleTemplateResponse, TemplateResponse,
+)
+from django.test import (
+ RequestFactory, SimpleTestCase, ignore_warnings, override_settings,
+)
from django.test.utils import require_jinja2
from django.utils._os import upath
from django.utils.deprecation import RemovedInDjango20Warning
diff --git a/tests/template_tests/test_unicode.py b/tests/template_tests/test_unicode.py
index 02d3d0a51d..b692bfe31c 100644
--- a/tests/template_tests/test_unicode.py
+++ b/tests/template_tests/test_unicode.py
@@ -3,10 +3,10 @@ from __future__ import unicode_literals
from unittest import TestCase
-from django.template import Template, Context
+from django.template import Context, Template
from django.template.base import TemplateEncodingError
-from django.utils.safestring import SafeData
from django.utils import six
+from django.utils.safestring import SafeData
class UnicodeTests(TestCase):
diff --git a/tests/template_tests/tests.py b/tests/template_tests/tests.py
index 8b93039dca..c57c3d1479 100644
--- a/tests/template_tests/tests.py
+++ b/tests/template_tests/tests.py
@@ -8,15 +8,18 @@ import unittest
from django import template
from django.contrib.auth.models import Group
from django.core import urlresolvers
-from django.template import (base as template_base, loader,
- Context, RequestContext, Template, TemplateSyntaxError)
+from django.template import (
+ Context, RequestContext, Template, TemplateSyntaxError,
+ base as template_base, loader,
+)
from django.template.engine import Engine
from django.template.loaders import app_directories, filesystem
from django.test import RequestFactory, SimpleTestCase
-from django.test.utils import extend_sys_path, ignore_warnings, override_settings
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.test.utils import (
+ extend_sys_path, ignore_warnings, override_settings,
+)
from django.utils._os import upath
-
+from django.utils.deprecation import RemovedInDjango20Warning
TESTS_DIR = os.path.dirname(os.path.dirname(os.path.abspath(upath(__file__))))
diff --git a/tests/template_tests/urls.py b/tests/template_tests/urls.py
index 2ddb6e232c..858f6d19f6 100644
--- a/tests/template_tests/urls.py
+++ b/tests/template_tests/urls.py
@@ -2,8 +2,8 @@
from __future__ import unicode_literals
from django.conf.urls import url
-from . import views
+from . import views
urlpatterns = [
# Test urls for testing reverse lookups
diff --git a/tests/template_tests/utils.py b/tests/template_tests/utils.py
index 588c1a4096..d5af69bdd6 100644
--- a/tests/template_tests/utils.py
+++ b/tests/template_tests/utils.py
@@ -2,8 +2,8 @@
from __future__ import unicode_literals
-import os
import functools
+import os
from django import template
from django.template import Library
@@ -14,7 +14,6 @@ from django.utils._os import upath
from django.utils.encoding import python_2_unicode_compatible
from django.utils.safestring import mark_safe
-
ROOT = os.path.dirname(os.path.abspath(upath(__file__)))