summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2018-05-14 09:33:35 -0400
committerTim Graham <timograham@gmail.com>2018-05-15 20:17:02 -0400
commit49a1736c2eb4a75b4eadc52f6cf9abc92f0f3bdf (patch)
tree7f26437fa41022b95a21e0213c68a3f5632ef4fd /tests
parent0a8a6b4683a4d40181e39e000fd3c05ab4b3f652 (diff)
Added assertion for admin change form's "save and continue editing" message.
Diffstat (limited to 'tests')
-rw-r--r--tests/admin_views/tests.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py
index cbd545a663..f8f3b3c269 100644
--- a/tests/admin_views/tests.py
+++ b/tests/admin_views/tests.py
@@ -4755,9 +4755,18 @@ class UserAdminTest(TestCase):
'_continue': '1',
})
new_user = User.objects.get(username='newuser')
- self.assertRedirects(response, reverse('admin:auth_user_change', args=(new_user.pk,)))
+ new_user_url = reverse('admin:auth_user_change', args=(new_user.pk,))
+ self.assertRedirects(response, new_user_url, fetch_redirect_response=False)
self.assertEqual(User.objects.count(), user_count + 1)
self.assertTrue(new_user.has_usable_password())
+ response = self.client.get(new_user_url)
+ self.assertContains(
+ response,
+ '<li class="success">The user "<a href="%s">'
+ '%s</a>" was added successfully. You may edit it again below.</li>'
+ % (new_user_url, new_user),
+ html=True,
+ )
def test_password_mismatch(self):
response = self.client.post(reverse('admin:auth_user_add'), {