Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ [#234] Validate DigitaalAdres.adres if type is email #271

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

stevenbal
Copy link
Collaborator

Fixes #234

Changes

  • Validate DigitaalAdres.adres if type is email

@@ -90,6 +92,54 @@ def test_create_digitaal_adres(self):
self.assertEqual(data["adres"], "foobar@example.com")
self.assertEqual(data["omschrijving"], "omschrijving")

def test_create_digitaal_adres_email_validation(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also add a test which verifies that whenever SoortPartij is not email no email validation is done?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already tested as part of test_update_digitaal_adres which uses SoortDigitaalAdres.telefoonnummer, is that enough or should I add a separate test case for it?

@@ -85,6 +88,7 @@ class Meta:
"help_text": _("De unieke URL van dit digitaal adres binnen deze API."),
},
}
validators = [OptionalEmailValidator()]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if this validation is also done in the admin (not only through the API).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validation of any stored email address
2 participants