mirror of https://github.com/django/django.git
Minor cleanups in templates test imports
This commit is contained in:
parent
687d2e967d
commit
335a060fa6
|
@ -19,10 +19,9 @@ except ImportError: # Python 2
|
||||||
from urlparse import urljoin
|
from urlparse import urljoin
|
||||||
|
|
||||||
from django import template
|
from django import template
|
||||||
from django.template import (base as template_base, Context, RequestContext,
|
|
||||||
Template)
|
|
||||||
from django.core import urlresolvers
|
from django.core import urlresolvers
|
||||||
from django.template import loader
|
from django.template import (base as template_base, loader, Context,
|
||||||
|
RequestContext, Template, TemplateSyntaxError)
|
||||||
from django.template.loaders import app_directories, filesystem, cached
|
from django.template.loaders import app_directories, filesystem, cached
|
||||||
from django.test import RequestFactory, TestCase
|
from django.test import RequestFactory, TestCase
|
||||||
from django.test.utils import (setup_test_template_loader,
|
from django.test.utils import (setup_test_template_loader,
|
||||||
|
@ -365,8 +364,6 @@ class Templates(TestCase):
|
||||||
@override_settings(SETTINGS_MODULE=None, TEMPLATE_DEBUG=True)
|
@override_settings(SETTINGS_MODULE=None, TEMPLATE_DEBUG=True)
|
||||||
def test_url_reverse_no_settings_module(self):
|
def test_url_reverse_no_settings_module(self):
|
||||||
# Regression test for #9005
|
# Regression test for #9005
|
||||||
from django.template import Template, Context
|
|
||||||
|
|
||||||
t = Template('{% url will_not_match %}')
|
t = Template('{% url will_not_match %}')
|
||||||
c = Context()
|
c = Context()
|
||||||
with self.assertRaises(urlresolvers.NoReverseMatch):
|
with self.assertRaises(urlresolvers.NoReverseMatch):
|
||||||
|
@ -417,7 +414,6 @@ class Templates(TestCase):
|
||||||
|
|
||||||
def test_invalid_block_suggestion(self):
|
def test_invalid_block_suggestion(self):
|
||||||
# See #7876
|
# See #7876
|
||||||
from django.template import Template, TemplateSyntaxError
|
|
||||||
try:
|
try:
|
||||||
t = Template("{% if 1 %}lala{% endblock %}{% endif %}")
|
t = Template("{% if 1 %}lala{% endblock %}{% endif %}")
|
||||||
except TemplateSyntaxError as e:
|
except TemplateSyntaxError as e:
|
||||||
|
|
Loading…
Reference in New Issue