From eac1423f9ebcf432dc5be95d605d124a05ab2686 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Sun, 28 Feb 2016 09:41:30 -0800 Subject: [PATCH] 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. --- tests/auth_tests/test_management.py | 34 ----------------------------- 1 file changed, 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)