Fix tests
This commit is contained in:
parent
8ca1be0166
commit
61b8bbdfcc
|
@ -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",
|
||||
{
|
||||
|
|
|
@ -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,
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue