Ticket #17980: 17980-simple.diff

File 17980-simple.diff, 1.3 KB (added by claudep, 3 years ago)

Simple patch: reset _default global variable

  • django/contrib/auth/tests/views.py

    diff --git a/django/contrib/auth/tests/views.py b/django/contrib/auth/tests/views.py
    index 7244086..66e873a 100644
    a b from django.utils.encoding import force_unicode 
    1313from django.utils.html import escape
    1414from django.test import TestCase
    1515from django.test.utils import override_settings
     16from django.utils.translation import trans_real
    1617
    1718from django.contrib.auth import SESSION_KEY, REDIRECT_FIELD_NAME
    1819from django.contrib.auth.forms import (AuthenticationForm, PasswordChangeForm,
    class AuthViewsTestCase(TestCase): 
    3132        self.old_LANGUAGE_CODE = settings.LANGUAGE_CODE
    3233        settings.LANGUAGES = (('en', 'English'),)
    3334        settings.LANGUAGE_CODE = 'en'
     35        trans_real._default = None
    3436        self.old_TEMPLATE_DIRS = settings.TEMPLATE_DIRS
    3537        settings.TEMPLATE_DIRS = (
    3638            os.path.join(os.path.dirname(__file__), 'templates'),
    class AuthViewsTestCase(TestCase): 
    3941    def tearDown(self):
    4042        settings.LANGUAGES = self.old_LANGUAGES
    4143        settings.LANGUAGE_CODE = self.old_LANGUAGE_CODE
     44        trans_real._default = None
    4245        settings.TEMPLATE_DIRS = self.old_TEMPLATE_DIRS
    4346
    4447    def login(self, password='password'):
Back to Top