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)