add "in_trial" to /user_info
This commit is contained in:
parent
f2d5230449
commit
2079b16431
|
@ -634,7 +634,8 @@ Output: if api key is correct, return a json with user name and whether user is
|
||||||
{
|
{
|
||||||
"name": "John Wick",
|
"name": "John Wick",
|
||||||
"is_premium": false,
|
"is_premium": false,
|
||||||
"email": "john@wick.com"
|
"email": "john@wick.com",
|
||||||
|
"in_trial": true
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -14,5 +14,10 @@ def user_info():
|
||||||
user = g.user
|
user = g.user
|
||||||
|
|
||||||
return jsonify(
|
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.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):
|
def test_wrong_api_key(flask_client):
|
||||||
|
|
Loading…
Reference in a new issue