@@ -35,29 +35,22 @@ def test_settings():
3535 'ROOT_URLCONF' : 'tests' ,
3636 }
3737
38- if django .VERSION >= (1 , 8 ):
39- the_settings .update ({
40- 'TEMPLATES' : [
41- {
42- 'BACKEND' : 'django.template.backends.django.DjangoTemplates' ,
43- 'DIRS' : ['templates' ], # where the tests put things.
44- 'OPTIONS' : {
45- 'debug' : True ,
46- },
38+ the_settings .update ({
39+ 'TEMPLATES' : [
40+ {
41+ 'BACKEND' : 'django.template.backends.django.DjangoTemplates' ,
42+ 'DIRS' : ['templates' ], # where the tests put things.
43+ 'OPTIONS' : {
44+ 'debug' : True ,
4745 },
48- ],
49- })
46+ },
47+ ],
48+ })
5049
51- if django .VERSION < (1 , 10 ):
52- # for {% ssi %}
53- the_settings ['TEMPLATES' ][0 ]['OPTIONS' ]['allowed_include_roots' ] = ['/' ]
50+ if django .VERSION < (1 , 10 ):
51+ # for {% ssi %}
52+ the_settings ['TEMPLATES' ][0 ]['OPTIONS' ]['allowed_include_roots' ] = ['/' ]
5453
55- else :
56- the_settings .update ({
57- 'ALLOWED_INCLUDE_ROOTS' : ['/' ], # for {% ssi %}
58- 'TEMPLATE_DEBUG' : True ,
59- 'TEMPLATE_DIRS' : ['templates' ], # where the tests put things.
60- })
6154
6255 return the_settings
6356
@@ -68,12 +61,10 @@ def test_settings():
6861 django .setup ()
6962
7063from django .template import Context , Template # noqa
64+ from django .template .backends .django import DjangoTemplates # noqa
7165from django .template .loader import get_template # noqa
7266from django .test import TestCase # noqa
7367
74- if django .VERSION >= (1 , 8 ):
75- from django .template .backends .django import DjangoTemplates # noqa
76-
7768
7869class DjangoPluginTestCase (StdStreamCapturingMixin , TempDirMixin , TestCase ):
7970 """A base class for all our tests."""
@@ -116,7 +107,7 @@ def run_django_coverage(
116107 str: the text produced by the template.
117108
118109 """
119- use_real_context = ( django . VERSION < ( 1 , 8 ))
110+ use_real_context = False
120111
121112 if options is None :
122113 options = {'source' : ["." ]}
@@ -256,7 +247,7 @@ def squashed(s):
256247def django_start_at (* needed_version ):
257248 """A decorator for tests to require a minimum version of Django.
258249
259- @django_start_at(1, 8 ) # Don't run the test on 1.7 or lower.
250+ @django_start_at(1, 10 ) # Don't run the test on 1.10 or lower.
260251 def test_thing(self):
261252 ...
262253
@@ -267,10 +258,10 @@ def test_thing(self):
267258 return unittest .skip ("Django version must be newer" )
268259
269260
270- def django_stop_at (* needed_version ):
261+ def django_stop_before (* needed_version ):
271262 """A decorator for tests to require a maximum version of Django.
272263
273- @django_stop_at (1, 8 ) # Don't run the test on 1.8 or higher.
264+ @django_stop_before (1, 10 ) # Don't run the test on 1.10 or higher.
274265 def test_thing(self):
275266 ...
276267
0 commit comments