make test more stable

This commit is contained in:
Son NK 2020-03-11 13:35:56 +01:00
parent c339cc1adf
commit eb66900ba3
1 changed files with 11 additions and 0 deletions

View File

@ -34,6 +34,17 @@ def test_success(flask_client):
new_ge = GenEmail.get_by(email=r.json["alias"])
assert new_ge.note == "test note"
def test_create_custom_alias_without_note(flask_client):
user = User.create(
email="a@b.c", password="password", name="Test User", activated=True
)
db.session.commit()
# create api_key
api_key = ApiKey.create(user.id, "for test")
db.session.commit()
# create alias without note
word = random_word()
r = flask_client.post(