Example #1
0
 def test_email_is_required(self):
     password = factory.make_name('password')
     params = {
         'email': '',
         'username': factory.make_name('user'),
         'password1': password,
         'password2': password,
     }
     form = NewUserCreationForm(params)
     self.assertFalse(form.is_valid())
     self.assertEqual({'email': ['This field is required.']}, form._errors)
Example #2
0
 def test_email_is_required(self):
     password = factory.make_name("password")
     params = {
         "email": "",
         "username": factory.make_name("user"),
         "password1": password,
         "password2": password,
     }
     form = NewUserCreationForm(params)
     self.assertFalse(form.is_valid())
     self.assertEqual({"email": ["This field is required."]}, form._errors)