Skip to content
Snippets Groups Projects
Unverified Commit ce27e7c2 authored by Fredrik Jonsson's avatar Fredrik Jonsson Committed by GitHub
Browse files

Merge pull request #751 from OpenTechFund/fix/validate-email-field

Make the e-mail stream field validate e-mail addresses.
parents dbaf2d7f caf775b3
No related branches found
No related tags found
No related merge requests found
......@@ -44,6 +44,7 @@ class EmailBlock(ApplicationMustIncludeFieldBlock):
name = 'email'
description = 'The applicant email address'
widget = forms.EmailInput
field_class = forms.EmailField
class Meta:
icon = 'mail'
......
......@@ -306,6 +306,11 @@ class TestFormSubmission(TestCase):
self.assertEqual(ApplicationSubmission.objects.count(), 0)
def test_valid_email(self):
email = 'not_a_valid_email@'
response = self.submit_form(email=email, ignore_errors=True)
self.assertContains(response, 'Enter a valid email address')
@override_settings(SEND_MESSAGES=True)
def test_email_sent_to_user_on_submission_fund(self):
self.submit_form()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment