mirror of
https://github.com/simple-login/app.git
synced 2024-11-16 08:58:30 +01:00
add test for custom alias page
This commit is contained in:
parent
ebadcfb175
commit
d8229102a6
1 changed files with 22 additions and 0 deletions
22
tests/dashboard/test_custom_alias.py
Normal file
22
tests/dashboard/test_custom_alias.py
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
from flask import url_for
|
||||||
|
|
||||||
|
from app.config import EMAIL_DOMAIN
|
||||||
|
from app.extensions import db
|
||||||
|
from app.utils import random_word
|
||||||
|
from tests.utils import login
|
||||||
|
|
||||||
|
|
||||||
|
def test_add_alias_success(flask_client):
|
||||||
|
login(flask_client)
|
||||||
|
db.session.commit()
|
||||||
|
|
||||||
|
word = random_word()
|
||||||
|
|
||||||
|
r = flask_client.post(
|
||||||
|
url_for("dashboard.custom_alias"),
|
||||||
|
data={"prefix": "prefix", "suffix": f".{word}@{EMAIL_DOMAIN}"},
|
||||||
|
follow_redirects=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
assert r.status_code == 200
|
||||||
|
assert f"Alias prefix.{word}@{EMAIL_DOMAIN} has been created" in str(r.data)
|
Loading…
Reference in a new issue