Skip to content

Use a guaranteed invalid email in sanitize_email #16

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JsseL
Copy link
Contributor

@JsseL JsseL commented Nov 15, 2018

TLD .invalid is quaranteed to be invalid by IETF RFC2606 hence it is safer than earlier sanitized.net, that could, in theory, have e.g. a working mail server.

@JsseL JsseL force-pushed the sanitized-email-domain branch from 17750da to 14def4f Compare November 15, 2018 08:02
@@ -59,9 +59,9 @@ def test_sanitize_surname_en_gb():


def test_sanitize_email_resets_on_session_reset():
assert user.sanitize_email('[email protected]') == (
'[email protected]')
assert user.sanitize_email('[email protected]') == (
Copy link
Member

Choose a reason for hiding this comment

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

You can't change the source address and expect it to sanitize to same value. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah.. we had the random hash there. 👍 Will check what it gave and update the expected value. I think having different source domain helps to understand the functionality easier.

@JsseL JsseL force-pushed the sanitized-email-domain branch from 14def4f to 5d80f0b Compare November 15, 2018 10:46
'[email protected]')
assert user.sanitize_email(' [email protected] ') == (
'[email protected]')
assert user.sanitize_email('test<@example.net') == (
Copy link
Member

Choose a reason for hiding this comment

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

Why did you add < to this email?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Slipped I guess. 👍

TLD `.invalid` is quaranteed to be invalid by IETF RFC2606 hence it is safer than earlier `sanitized.net`, that could, in theory, have e.g. a working mail server.
@JsseL JsseL force-pushed the sanitized-email-domain branch from 5d80f0b to cb1cea6 Compare November 15, 2018 20:07
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.

2 participants