summaryrefslogtreecommitdiff
path: root/tests/auth_tests
diff options
context:
space:
mode:
authorJacob Walls <jacobtylerwalls@gmail.com>2024-07-03 07:51:50 -0400
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2024-07-04 11:35:03 +0200
commit31837dbcb36f1ab57fb1b16cb0b126c55a1bdf01 (patch)
tree6b99038a1fb308be9e208eebdf0c138e07da2b9b /tests/auth_tests
parent704192e478885762411252979021771ba23b8adb (diff)
Fixed #35569 -- Improved wording of invalid ForeignKey error message.
Diffstat (limited to 'tests/auth_tests')
-rw-r--r--tests/auth_tests/test_management.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/auth_tests/test_management.py b/tests/auth_tests/test_management.py
index 5765c50034..8dd91cf6ed 100644
--- a/tests/auth_tests/test_management.py
+++ b/tests/auth_tests/test_management.py
@@ -523,7 +523,7 @@ class CreatesuperuserManagementCommandTestCase(TestCase):
self.assertEqual(u.group, group)
non_existent_email = "mymail2@gmail.com"
- msg = "email instance with email %r does not exist." % non_existent_email
+ msg = "email instance with email %r is not a valid choice." % non_existent_email
with self.assertRaisesMessage(CommandError, msg):
call_command(
"createsuperuser",
@@ -594,7 +594,7 @@ class CreatesuperuserManagementCommandTestCase(TestCase):
email = Email.objects.create(email="mymail@gmail.com")
Group.objects.all().delete()
nonexistent_group_id = 1
- msg = f"group instance with id {nonexistent_group_id} does not exist."
+ msg = f"group instance with id {nonexistent_group_id} is not a valid choice."
with self.assertRaisesMessage(CommandError, msg):
call_command(
@@ -611,7 +611,7 @@ class CreatesuperuserManagementCommandTestCase(TestCase):
email = Email.objects.create(email="mymail@gmail.com")
Group.objects.all().delete()
nonexistent_group_id = 1
- msg = f"group instance with id {nonexistent_group_id} does not exist."
+ msg = f"group instance with id {nonexistent_group_id} is not a valid choice."
with mock.patch.dict(
os.environ,
@@ -631,7 +631,7 @@ class CreatesuperuserManagementCommandTestCase(TestCase):
email = Email.objects.create(email="mymail@gmail.com")
Group.objects.all().delete()
nonexistent_group_id = 1
- msg = f"group instance with id {nonexistent_group_id} does not exist."
+ msg = f"group instance with id {nonexistent_group_id} is not a valid choice."
@mock_inputs(
{