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

Thanks andrey@kostenko.name for the report.
This commit is contained in:
Claude Paroz 2012-09-15 21:39:08 +02:00
parent b1fb6f4820
commit c7f44ae085
2 changed files with 10 additions and 2 deletions

View File

@ -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 @@ from django.contrib.auth.forms import (AuthenticationForm, PasswordChangeForm,
('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 File

@ -51,6 +51,13 @@ def clear_context_processors_cache(**kwargs):
context._standard_context_processors = None
@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':