Skip to content

Commit

Permalink
Fix the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Fantomas42 committed Apr 8, 2015
1 parent db5a0f6 commit 0fdfc2f
Showing 1 changed file with 37 additions and 5 deletions.
42 changes: 37 additions & 5 deletions app_namespace/tests/tests.py
Expand Up @@ -89,7 +89,16 @@ def test_load_template_source_dotted_namespace(self):
TEMPLATE_LOADERS=(
'app_namespace.Loader',
'django.template.loaders.app_directories.Loader',
)
),
TEMPLATES=[
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'OPTIONS': {
'loaders': ('app_namespace.Loader',
'django.template.loaders.app_directories.Loader')
}
}
]
)
class TemplateTestCase(TestCase):
maxDiff = None
Expand Down Expand Up @@ -206,6 +215,7 @@ class MultiAppTestCase(TestCase):
"""

def setUp(self):
super(MultiAppTestCase, self).setUp()
# Create a temp directory containing apps
# accessible on the PYTHONPATH.
self.app_directory = tempfile.mkdtemp()
Expand All @@ -231,6 +241,7 @@ def setUp(self):
settings.INSTALLED_APPS.extend(self.apps)

def tearDown(self):
super(MultiAppTestCase, self).tearDown()
sys.path.remove(self.app_directory)
for app in self.apps:
del sys.modules[app]
Expand All @@ -254,7 +265,17 @@ def multiple_extend_empty_namespace(self):
TEMPLATE_LOADERS=(
'app_namespace.Loader',
'django.template.loaders.app_directories.Loader',
)
),
TEMPLATES=[
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'OPTIONS': {
'loaders': (
'app_namespace.Loader',
'django.template.loaders.app_directories.Loader')
}
}
]
)
def test_multiple_extend_empty_namespace(self):
self.multiple_extend_empty_namespace()
Expand All @@ -265,10 +286,21 @@ def test_multiple_extend_empty_namespace(self):
TEMPLATE_LOADERS=(
('django.template.loaders.cached.Loader', (
'app_namespace.Loader',
'django.template.loaders.app_directories.Loader',
)
'django.template.loaders.app_directories.Loader')
),
)
),
TEMPLATES=[
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'OPTIONS': {
'loaders': [
('django.template.loaders.cached.Loader', [
'app_namespace.Loader',
'django.template.loaders.app_directories.Loader']),
]
}
}
]
)
def test_cached_multiple_extend_empty_namespace(self):
with self.assertRaises(RuntimeError):
Expand Down

0 comments on commit 0fdfc2f

Please sign in to comment.