From d113390ab425921ac08bf53cd4b3d25e2a4057f0 Mon Sep 17 00:00:00 2001 From: Matt Westcott Date: Fri, 4 Sep 2015 14:35:43 +0100 Subject: [PATCH] failing test for #1665 --- wagtail/wagtailusers/tests.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/wagtail/wagtailusers/tests.py b/wagtail/wagtailusers/tests.py index f70b001653..5d59712254 100644 --- a/wagtail/wagtailusers/tests.py +++ b/wagtail/wagtailusers/tests.py @@ -82,6 +82,24 @@ class TestUserCreateView(TestCase, WagtailTestUtils): self.assertEqual(users.count(), 1) self.assertEqual(users.first().email, 'test@user.com') + def test_create_with_password_mismatch(self): + response = self.post({ + 'username': "testuser", + 'email': "test@user.com", + 'first_name': "Test", + 'last_name': "User", + 'password1': "password1", + 'password2': "password2", + }) + + # Should remain on page + self.assertEqual(response.status_code, 200) + self.assertTemplateUsed(response, 'wagtailusers/users/create.html') + + # Check that the user was not created + users = get_user_model().objects.filter(username='testuser') + self.assertEqual(users.count(), 0) + class TestUserEditView(TestCase, WagtailTestUtils): def setUp(self):