def test_case_insensitive_email_already_in_use(self): form = SignupForm(data={'email': '*****@*****.**'}) self.assertFalse(form.is_valid()) self.assertIn('email', form.errors) self.assertEqual(len(form.errors['email']), 1) self.assertIn('This email address is already in use.', form.errors['email'][0])
def test_case_insensitive_email_already_in_use(self): form = SignupForm(data={"email": "*****@*****.**"}) self.assertFalse(form.is_valid()) self.assertIn("email", form.errors) self.assertEqual(len(form.errors["email"]), 1) self.assertIn("This email address is already in use.", form.errors["email"][0])
def test_submit_invalid_email(self): form = SignupForm(data={'email': '*****@*****.**'}) self.assertFalse(form.is_valid()) self.assertIn('email', form.errors) self.assertEqual( form.errors['email'], ['<p>This address does not end in <code>@example.org</code>.</p>'])
def test_submit_invalid_email(self): form = SignupForm(data={"email": "*****@*****.**"}) self.assertFalse(form.is_valid()) self.assertIn("email", form.errors) self.assertEqual( form.errors["email"], ["<p>This address does not end in <code>@example.org</code>.</p>"])
def test_submit_invalid_email(self): form = SignupForm(data={"email": "*****@*****.**"}) self.assertFalse(form.is_valid()) self.assertIn("email", form.errors) self.assertEqual(form.errors["email"], [ "<p>This address does not end in <code>@example.org</code>.</p>" ])
def test_case_insensitive_user_already_exists(self): form = SignupForm(data={'username': '******'}) self.assertFalse(form.is_valid()) self.assertIn('username', form.errors) self.assertEqual(form.errors['username'], ['A user with that username already exists.'])
def test_case_insensitive_user_already_exists(self): form = SignupForm(data={"username": "******"}) self.assertFalse(form.is_valid()) self.assertIn("username", form.errors) self.assertEqual(form.errors["username"], ["A user with that username already exists."])