mirror of
https://github.com/simple-login/app.git
synced 2024-11-15 13:14:36 +08:00
26 lines
642 B
Python
26 lines
642 B
Python
|
import json
|
||
|
|
||
|
from app.models import CustomDomain
|
||
|
from tests.utils import login
|
||
|
|
||
|
|
||
|
def test_get_custom_domains(flask_client):
|
||
|
user = login(flask_client)
|
||
|
|
||
|
CustomDomain.create(user_id=user.id, domain="test1.org", verified=True, commit=True)
|
||
|
CustomDomain.create(
|
||
|
user_id=user.id, domain="test2.org", verified=False, commit=True
|
||
|
)
|
||
|
|
||
|
r = flask_client.get(
|
||
|
"/api/custom_domains",
|
||
|
)
|
||
|
|
||
|
assert r.status_code == 200
|
||
|
assert r.json == {
|
||
|
"custom_domains": [
|
||
|
{"domain": "test1.org", "id": 1, "verified": True},
|
||
|
{"domain": "test2.org", "id": 2, "verified": False},
|
||
|
]
|
||
|
}
|