This commit is contained in:
Son 2022-04-14 18:53:27 +02:00
parent 217518c00e
commit 7edbc3a5d5

View file

@ -102,9 +102,7 @@ def test_different_scenarios_v5(flask_client):
user = login(flask_client) user = login(flask_client)
# <<< without hostname >>> # <<< without hostname >>>
r = flask_client.get( r = flask_client.get("/api/v5/alias/options")
"/api/v5/alias/options"
)
assert r.status_code == 200 assert r.status_code == 200
@ -122,15 +120,11 @@ def test_different_scenarios_v5(flask_client):
assert "is_premium" in suffix_payload assert "is_premium" in suffix_payload
# <<< with hostname >>> # <<< with hostname >>>
r = flask_client.get( r = flask_client.get("/api/v5/alias/options?hostname=www.test.com")
"/api/v5/alias/options?hostname=www.test.com"
)
assert r.json["prefix_suggestion"] == "test" assert r.json["prefix_suggestion"] == "test"
# <<< with hostname with 2 parts TLD, for example wwww.numberoneshoes.co.nz >>> # <<< with hostname with 2 parts TLD, for example wwww.numberoneshoes.co.nz >>>
r = flask_client.get( r = flask_client.get("/api/v5/alias/options?hostname=wwww.numberoneshoes.co.nz")
"/api/v5/alias/options?hostname=wwww.numberoneshoes.co.nz"
)
assert r.json["prefix_suggestion"] == "numberoneshoes" assert r.json["prefix_suggestion"] == "numberoneshoes"
# <<< with recommendation >>> # <<< with recommendation >>>
@ -141,8 +135,6 @@ def test_different_scenarios_v5(flask_client):
) )
Session.commit() Session.commit()
r = flask_client.get( r = flask_client.get(url_for("api.options_v4", hostname="www.test.com"))
url_for("api.options_v4", hostname="www.test.com")
)
assert r.json["recommendation"]["alias"] == alias.email assert r.json["recommendation"]["alias"] == alias.email
assert r.json["recommendation"]["hostname"] == "www.test.com" assert r.json["recommendation"]["hostname"] == "www.test.com"