Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #17948 -- Isolated auth tests from custom template loaders

Thanks andrey@kostenko.name for the report.
  • Loading branch information...
commit c7f44ae085df3a270aa998cdedb56f36900cb9ef 1 parent b1fb6f4
@claudep claudep authored
Showing with 10 additions and 2 deletions.
  1. +3 −2 django/contrib/auth/tests/views.py
  2. +7 −0 django/test/signals.py
View
5 django/contrib/auth/tests/views.py
@@ -1,7 +1,7 @@
import os
import re
-from django.conf import settings
+from django.conf import global_settings, settings
from django.contrib.sites.models import Site, RequestSite
from django.contrib.auth.models import User
from django.core import mail
@@ -23,7 +23,8 @@
('en', 'English'),
),
LANGUAGE_CODE='en',
- TEMPLATE_DIRS = (
+ TEMPLATE_LOADERS=global_settings.TEMPLATE_LOADERS,
+ TEMPLATE_DIRS=(
os.path.join(os.path.dirname(__file__), 'templates'),
),
USE_TZ=False,
View
7 django/test/signals.py
@@ -52,6 +52,13 @@ def clear_context_processors_cache(**kwargs):
@receiver(setting_changed)
+def clear_template_loaders_cache(**kwargs):
+ if kwargs['setting'] == 'TEMPLATE_LOADERS':
+ from django.template import loader
+ loader.template_source_loaders = None
+
+
+@receiver(setting_changed)
def clear_serializers_cache(**kwargs):
if kwargs['setting'] == 'SERIALIZATION_MODULES':
from django.core import serializers
Please sign in to comment.
Something went wrong with that request. Please try again.