summaryrefslogtreecommitdiff
path: root/tests/auth_tests/test_management.py
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2016-02-28 09:41:30 -0800
committerTim Graham <timograham@gmail.com>2016-02-29 08:46:37 -0500
commiteac1423f9ebcf432dc5be95d605d124a05ab2686 (patch)
treee634ecd0c7fb8ce83fda18dcd6883aa4b0c0ec71 /tests/auth_tests/test_management.py
parent6a383f773a178a61bcbce5464c7e49fdaecd8ed0 (diff)
Removed obsolete test CreatesuperuserManagementCommandTestCase.test_nolocale.
Test was added in 4c934f3921a59c7b3e088f6472b6f6da40848567 to verify that the commend works when locale.getdefaultlocale() doesn't return a locale. getdefaultlocale() no longer runs at runtime, so the test isn't needed.
Diffstat (limited to 'tests/auth_tests/test_management.py')
-rw-r--r--tests/auth_tests/test_management.py34
1 files changed, 0 insertions, 34 deletions
diff --git a/tests/auth_tests/test_management.py b/tests/auth_tests/test_management.py
index a6deb6454a..e8388db763 100644
--- a/tests/auth_tests/test_management.py
+++ b/tests/auth_tests/test_management.py
@@ -1,6 +1,5 @@
from __future__ import unicode_literals
-import locale
import sys
from datetime import date
@@ -203,39 +202,6 @@ class CreatesuperuserManagementCommandTestCase(TestCase):
# created password should be unusable
self.assertFalse(u.has_usable_password())
- @mock_inputs({'password': "nopasswd"})
- def test_nolocale(self):
- """
- Check that createsuperuser does not break when no locale is set. See
- ticket #16017.
- """
-
- old_getdefaultlocale = locale.getdefaultlocale
- try:
- # Temporarily remove locale information
- locale.getdefaultlocale = lambda: (None, None)
-
- # Call the command in this new environment
- call_command(
- "createsuperuser",
- interactive=True,
- username="nolocale@somewhere.org",
- email="nolocale@somewhere.org",
- verbosity=0,
- stdin=MockTTY(),
- )
-
- except TypeError:
- self.fail("createsuperuser fails if the OS provides no information about the current locale")
-
- finally:
- # Re-apply locale information
- locale.getdefaultlocale = old_getdefaultlocale
-
- # If we were successful, a user should have been created
- u = User.objects.get(username="nolocale@somewhere.org")
- self.assertEqual(u.email, 'nolocale@somewhere.org')
-
@mock_inputs({
'password': "nopasswd",
'u\u017eivatel': 'foo', # username (cz)