-
-
Notifications
You must be signed in to change notification settings - Fork 421
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Allow to create mailboxes for a custom domain if they are not sl…
… domains (#2236)
- Loading branch information
Showing
2 changed files
with
10 additions
and
3 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 |
---|---|---|
|
@@ -90,12 +90,19 @@ def test_can_be_used_as_personal_email(flask_client): | |
assert not email_can_be_used_as_mailbox("[email protected]") | ||
assert not email_can_be_used_as_mailbox("[email protected]") | ||
|
||
# custom domain | ||
# custom domain as SL domain | ||
domain = random_domain() | ||
user = create_new_user() | ||
CustomDomain.create(user_id=user.id, domain=domain, verified=True, commit=True) | ||
domain_obj = CustomDomain.create( | ||
user_id=user.id, domain=domain, verified=True, is_sl_subdomain=True, flush=True | ||
) | ||
assert not email_can_be_used_as_mailbox(f"hey@{domain}") | ||
|
||
# custom domain is NOT SL domain | ||
domain_obj.is_sl_subdomain = False | ||
Session.flush() | ||
assert email_can_be_used_as_mailbox(f"hey@{domain}") | ||
|
||
# disposable domain | ||
disposable_domain = random_domain() | ||
InvalidMailboxDomain.create(domain=disposable_domain, commit=True) | ||
|