Fixed #19839 -- Isolated auth tests from customized TEMPLATE_LOADERS

Thanks limscoder for the report.
This commit is contained in:
Claude Paroz 2013-02-18 09:20:26 +01:00
parent 9c2066d567
commit 5ec0405a09
2 changed files with 18 additions and 13 deletions

View File

@ -63,6 +63,7 @@ class PermWrapperTests(TestCase):
@skipIfCustomUser @skipIfCustomUser
@override_settings( @override_settings(
TEMPLATE_LOADERS=('django.template.loaders.filesystem.Loader',),
TEMPLATE_DIRS=( TEMPLATE_DIRS=(
os.path.join(os.path.dirname(upath(__file__)), 'templates'), os.path.join(os.path.dirname(upath(__file__)), 'templates'),
), ),

View File

@ -341,9 +341,13 @@ class PasswordResetFormTest(TestCase):
self.assertTrue(form.is_valid()) self.assertTrue(form.is_valid())
self.assertEqual(form.cleaned_data['email'], email) self.assertEqual(form.cleaned_data['email'], email)
@override_settings(
TEMPLATE_LOADERS=('django.template.loaders.filesystem.Loader',),
TEMPLATE_DIRS=(
os.path.join(os.path.dirname(upath(__file__)), 'templates'),
),
)
def test_custom_email_subject(self): def test_custom_email_subject(self):
template_path = os.path.join(os.path.dirname(upath(__file__)), 'templates')
with self.settings(TEMPLATE_DIRS=(template_path,)):
data = {'email': 'testclient@example.com'} data = {'email': 'testclient@example.com'}
form = PasswordResetForm(data) form = PasswordResetForm(data)
self.assertTrue(form.is_valid()) self.assertTrue(form.is_valid())