Exemplo n.º 1
0
 def test_valid_form(self):
     u = UserFactory(email='*****@*****.**')
     form = EmailConfirmForm({'email': '*****@*****.**'})
     self.assertTrue(form.is_valid())
     # Test get_user
     self.assertEqual(form.get_user(), u)
Exemplo n.º 2
0
 def test_invalid_form(self):
     form = EmailConfirmForm({'email': '*****@*****.**'})
     self.assertFalse(form.is_valid())
     self.assertEqual(form.errors['email'], [str(form.error_messages.get('not_user'))])