Fix tests

This commit is contained in:
Adrià Casajús 2022-04-06 17:07:36 +02:00
parent 8ca1be0166
commit 61b8bbdfcc
No known key found for this signature in database
GPG Key ID: F0033226A5AFC9B9
2 changed files with 5 additions and 6 deletions

View File

@ -172,7 +172,7 @@ def generate_dmarc_result() -> List:
@pytest.mark.parametrize("dmarc_result", generate_dmarc_result())
def test_dmarc_reply_quarantine(dmarc_result: str):
def test_dmarc_reply_quarantine(flask_client, dmarc_result):
user = create_random_user()
alias = Alias.create_new_random(user)
Session.commit()
@ -183,9 +183,8 @@ def test_dmarc_reply_quarantine(dmarc_result: str):
name="Name {}".format(int(random.random())),
reply_email="random-{}@{}".format(random.random(), EMAIL_DOMAIN),
automatic_created=True,
flush=True,
commit=True,
)
Session.commit()
msg = load_eml_file(
"dmarc_reply_check.eml",
{

View File

@ -39,11 +39,11 @@ def random_token(length: int = 10) -> str:
def create_random_user() -> User:
email = "{}@{}.com".format(random_token(), random_token())
random_email = "{}@{}.com".format(random_token(), random_token())
return User.create(
email=email,
email=random_email,
password="password",
name="Test User",
name="Test {}".format(random_token()),
activated=True,
commit=True,
)