summaryrefslogtreecommitdiff
path: root/tests/auth_tests/test_management.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auth_tests/test_management.py')
-rw-r--r--tests/auth_tests/test_management.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/auth_tests/test_management.py b/tests/auth_tests/test_management.py
index c4368b3bcf..c43091d932 100644
--- a/tests/auth_tests/test_management.py
+++ b/tests/auth_tests/test_management.py
@@ -158,7 +158,8 @@ class ChangepasswordManagementCommandTestCase(TestCase):
A CommandError should be thrown by handle() if the user enters in
mismatched passwords three times.
"""
- with self.assertRaises(CommandError):
+ msg = "Aborting password change for user 'joe' after 3 attempts"
+ with self.assertRaisesMessage(CommandError, msg):
call_command('changepassword', username='joe', stdout=self.stdout, stderr=self.stderr)
@mock.patch.object(changepassword.Command, '_get_pass', return_value='1234567890')
@@ -316,7 +317,7 @@ class CreatesuperuserManagementCommandTestCase(TestCase):
# We skip validation because the temporary substitution of the
# swappable User model messes with validation.
new_io = StringIO()
- with self.assertRaises(CommandError):
+ with self.assertRaisesMessage(CommandError, 'You must use --email with --noinput.'):
call_command(
"createsuperuser",
interactive=False,