Update tests

This commit is contained in:
Adrià Casajús 2024-08-05 11:52:15 +02:00
parent 8dfa886024
commit 80d1369bf9
No known key found for this signature in database
GPG Key ID: F0033226A5AFC9B9

View File

@ -25,28 +25,28 @@ def teardown_module():
def test_set_default_mailbox():
other = create_new_user()
mailbox = mailbox_utils.create_mailbox(
output = mailbox_utils.create_mailbox(
other,
random_email(),
use_digit_codes=True,
send_link=False,
)
mailbox.verified = True
output.mailbox.verified = True
Session.commit()
user_settings.set_default_mailbox(other, mailbox.id)
user_settings.set_default_mailbox(other, output.mailbox.id)
other = User.get(other.id)
assert other.default_mailbox_id == mailbox.id
assert other.default_mailbox_id == output.mailbox.id
def test_cannot_set_unverified():
mailbox = mailbox_utils.create_mailbox(
output = mailbox_utils.create_mailbox(
user,
random_email(),
use_digit_codes=True,
send_link=False,
)
with pytest.raises(user_settings.CannotSetMailbox):
user_settings.set_default_mailbox(user, mailbox.id)
user_settings.set_default_mailbox(user, output.mailbox.id)
def test_cannot_default_other_user_mailbox():