mirror of
https://github.com/simple-login/app.git
synced 2024-11-16 00:48:32 +01:00
add "in_trial" to /user_info
This commit is contained in:
parent
46701530db
commit
7d61c5d8c2
3 changed files with 14 additions and 3 deletions
|
@ -651,7 +651,8 @@ Output: if api key is correct, return a json with user name and whether user is
|
|||
{
|
||||
"name": "John Wick",
|
||||
"is_premium": false,
|
||||
"email": "john@wick.com"
|
||||
"email": "john@wick.com",
|
||||
"in_trial": true
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
@ -14,5 +14,10 @@ def user_info():
|
|||
user = g.user
|
||||
|
||||
return jsonify(
|
||||
{"name": user.name, "is_premium": user.is_premium(), "email": user.email}
|
||||
{
|
||||
"name": user.name,
|
||||
"is_premium": user.is_premium(),
|
||||
"email": user.email,
|
||||
"in_trial": user.in_trial(),
|
||||
}
|
||||
)
|
||||
|
|
|
@ -19,7 +19,12 @@ def test_user_in_trial(flask_client):
|
|||
)
|
||||
|
||||
assert r.status_code == 200
|
||||
assert r.json == {"is_premium": True, "name": "Test User", "email": "a@b.c"}
|
||||
assert r.json == {
|
||||
"is_premium": True,
|
||||
"name": "Test User",
|
||||
"email": "a@b.c",
|
||||
"in_trial": True,
|
||||
}
|
||||
|
||||
|
||||
def test_wrong_api_key(flask_client):
|
||||
|
|
Loading…
Reference in a new issue