예제 #1
0
 def test_clean_password2_passwords_do_not_match(self):
     self.testdata['password2'] = 'test2345'
     form = UserCreationForm(data=self.testdata)
     self.assertFalse(form.is_valid())
     self.assertEqual(len(form.errors['password2']), 1)
     self.assertEqual(form.errors['password2'], [PASSWORD_MISMATCH_ERROR])
예제 #2
0
 def test_clean_password2_passwords_match(self):
     form = UserCreationForm(data=self.testdata)
     self.assertTrue(form.is_valid(), str(form.errors))
     self.assertEqual(form.cleaned_data['password2'], 'test1234')