-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
YDA-5380: add option for validating email address
This is primarily meant to be used on environments that have local user accounts with a non-email address username that invite external users.
- Loading branch information
Showing
5 changed files
with
104 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ SMTP_FROM_EMAIL = '[email protected]' | |
SMTP_REPLYTO_NAME = 'PLACEHOLDER' | ||
SMTP_REPLYTO_EMAIL = '[email protected]' | ||
MAIL_ENABLED = 'false' | ||
MAIL_ONLY_TO_VALID_ADDRESS = 'false' | ||
MAIL_TEMPLATE = 'uu' | ||
MAIL_TEMPLATE_DIR = "/var/www/extuser/yoda-external-user-service/yoda_eus/templates/mail" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
|
||
import string | ||
|
||
from yoda_eus.mail import is_email_valid | ||
from yoda_eus.password_complexity import check_password_complexity | ||
|
||
|
||
|
@@ -46,3 +47,9 @@ def test_password_validation_multiple(self): | |
assert "Password is too short: it needs to be at least 10 characters." in result | ||
assert "Password needs to contain at least one digit." in result | ||
assert "Password needs to contain at least one punctuation character ({})".format(string.punctuation) in result | ||
|
||
def is_email_valid_yes(self): | ||
assert is_email_valid("[email protected]") | ||
|
||
def is_email_valid_no(self): | ||
assert not is_email_valid("this is not a valid email address") |