-
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.
`export EMAIL_TEST_ACCOUNT_a_at_test_com=123456` then (pretend) send email to `[email protected]`, verify token using the preset value `123456`.
- Loading branch information
Showing
3 changed files
with
39 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from django.conf import settings | ||
from os import getenv | ||
|
||
def get_test_account_token(email): | ||
name = email.replace('@', '_at_').replace('.', '_') | ||
env = '{}{}'.format(settings.EMAIL_TEST_ACCOUNT_PREFIX, name) | ||
return getenv(env) | ||
|
||
|
||
def exists_test_account(email): | ||
return bool(get_test_account_token(email)) |
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