Removed unnecessary inner methods in CreatesuperuserManagementCommandTestCase.
@@ -707,8 +707,6 @@ class CreatesuperuserManagementCommandTestCase(TestCase):
def test_blank_username(self):
"""Creation fails if --username is blank."""
new_io = StringIO()
-
- def test(self):
with self.assertRaisesMessage(CommandError, 'Username cannot be blank.'):
call_command(
'createsuperuser',
@@ -718,12 +716,8 @@ class CreatesuperuserManagementCommandTestCase(TestCase):
stderr=new_io,
)
- test(self)
-
def test_blank_username_non_interactive(self):
new_io = StringIO()
-
- def test(self):
with self.assertRaisesMessage(CommandError, 'Username cannot be blank.'):
call_command(
'createsuperuser',
@@ -734,8 +728,6 @@ class CreatesuperuserManagementCommandTestCase(TestCase):
stderr=new_io,
)
- test(self)
-
def test_password_validation_bypass(self):
"""
Password validation can be bypassed by entering 'y' at the prompt.
@@ -952,8 +944,6 @@ class CreatesuperuserManagementCommandTestCase(TestCase):
@override_settings(AUTH_USER_MODEL='auth_tests.NoPasswordUser')
def test_usermodel_without_password(self):
new_io = StringIO()
-
- def test(self):
call_command(
'createsuperuser',
interactive=False,
@@ -964,8 +954,6 @@ class CreatesuperuserManagementCommandTestCase(TestCase):
)
self.assertEqual(new_io.getvalue().strip(), 'Superuser created successfully.')
- test(self)
-
@override_settings(AUTH_USER_MODEL='auth_tests.NoPasswordUser')
def test_usermodel_without_password_interactive(self):
new_io = StringIO()
