diff --git a/django/contrib/auth/tests/forms.py b/django/contrib/auth/tests/forms.py
index 2bacc8e..b65f3fc 100644
a
|
b
|
class PasswordResetFormTest(TestCase):
|
303 | 303 | form = PasswordResetForm(data) |
304 | 304 | self.assertFalse(form.is_valid()) |
305 | 305 | self.assertEqual(form["email"].errors, |
306 | | [u"The user account associated with this e-mail address cannot reset the password."]) |
| 306 | [PasswordResetForm.error_messages['unusable']]) |
diff --git a/django/contrib/auth/tests/views.py b/django/contrib/auth/tests/views.py
index 1975266..2ffa8d5 100644
a
|
b
|
from django.core.urlresolvers import reverse, NoReverseMatch
|
11 | 11 | from django.http import QueryDict |
12 | 12 | from django.utils.encoding import force_unicode |
13 | 13 | from django.utils.html import escape |
| 14 | from django.template import loader |
14 | 15 | from django.test import TestCase |
15 | 16 | |
16 | 17 | from django.contrib.auth import SESSION_KEY, REDIRECT_FIELD_NAME |
… |
… |
class AuthViewsTestCase(TestCase):
|
34 | 35 | settings.TEMPLATE_DIRS = ( |
35 | 36 | os.path.join(os.path.dirname(__file__), 'templates'), |
36 | 37 | ) |
| 38 | self.old_TEMPLATE_LOADERS = settings.TEMPLATE_LOADERS |
| 39 | settings.TEMPLATE_LOADERS = ('django.template.loaders.filesystem.Loader', |
| 40 | 'django.template.loaders.app_directories.Loader') |
| 41 | loader.template_source_loaders = None #Flushing loader cache |
37 | 42 | |
38 | 43 | def tearDown(self): |
39 | 44 | settings.LANGUAGES = self.old_LANGUAGES |
40 | 45 | settings.LANGUAGE_CODE = self.old_LANGUAGE_CODE |
41 | 46 | settings.TEMPLATE_DIRS = self.old_TEMPLATE_DIRS |
| 47 | settings.TEMPLATE_LOADERS = self.old_TEMPLATE_LOADERS |
| 48 | loader.template_source_loaders = None #Flushing loader cache |
42 | 49 | |
43 | 50 | def login(self, password='password'): |
44 | 51 | response = self.client.post('/login/', { |
diff --git a/django/core/management/base.py b/django/core/management/base.py
index db855e1..a9fc38c 100644
a
|
b
|
class BaseCommand(object):
|
247 | 247 | else: |
248 | 248 | self.stderr.write(smart_str(self.style.ERROR('Error: %s\n' % e))) |
249 | 249 | sys.exit(1) |
250 | | if saved_lang is not None: |
251 | | translation.activate(saved_lang) |
| 250 | finally: |
| 251 | if saved_lang is not None: |
| 252 | translation.activate(saved_lang) |
252 | 253 | |
253 | 254 | def validate(self, app=None, display_num_errors=False): |
254 | 255 | """ |