Author: mtredinnick
Date: 2009-04-18 22:41:33 -0500 (Sat, 18 Apr 2009)
New Revision: 10599

Modified:
   django/trunk/django/contrib/auth/tests/views.py
Log:
Fixed #8752 -- Fixed django.contrib.auth tests to be locale-independent.

Patch from Koen Biermans.

Modified: django/trunk/django/contrib/auth/tests/views.py
===================================================================
--- django/trunk/django/contrib/auth/tests/views.py     2009-04-19 03:06:29 UTC 
(rev 10598)
+++ django/trunk/django/contrib/auth/tests/views.py     2009-04-19 03:41:33 UTC 
(rev 10599)
@@ -18,6 +18,10 @@
     urls = 'django.contrib.auth.urls'
 
     def setUp(self):
+        self.old_LANGUAGES = settings.LANGUAGES
+        self.old_LANGUAGE_CODE = settings.LANGUAGE_CODE
+        settings.LANGUAGES = (('en', 'English'),)
+        settings.LANGUAGE_CODE = 'en'
         self.old_TEMPLATE_DIRS = settings.TEMPLATE_DIRS
         settings.TEMPLATE_DIRS = (
             os.path.join(
@@ -27,10 +31,22 @@
         ,)
 
     def tearDown(self):
+        settings.LANGUAGES = self.old_LANGUAGES
+        settings.LANGUAGE_CODE = self.old_LANGUAGE_CODE
         settings.TEMPLATE_DIRS = self.old_TEMPLATE_DIRS
 
 class PasswordResetTest(AuthViewsTestCase):
 
+    def setUp(self):
+        self.old_LANGUAGES = settings.LANGUAGES
+        self.old_LANGUAGE_CODE = settings.LANGUAGE_CODE
+        settings.LANGUAGES = (('en', 'English'),)
+        settings.LANGUAGE_CODE = 'en'
+
+    def tearDown(self):
+        settings.LANGUAGES = self.old_LANGUAGES
+        settings.LANGUAGE_CODE = self.old_LANGUAGE_CODE
+
     def test_email_not_found(self):
         "Error is raised if the provided email address isn't currently 
registered"
         response = self.client.get('/password_reset/')
@@ -224,4 +240,4 @@
         response = self.client.get('/logout/custom_query/?follow=/somewhere/')
         self.assertEqual(response.status_code, 302)
         self.assert_(response['Location'].endswith('/somewhere/'))
-        self.confirm_logged_out()
\ No newline at end of file
+        self.confirm_logged_out()


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to