mirror of
https://github.com/simple-login/app.git
synced 2025-02-22 23:02:55 +08:00
return title in /api/notifications
This commit is contained in:
parent
3422f038eb
commit
5b7949f346
3 changed files with 5 additions and 1 deletions
|
@ -22,6 +22,7 @@ def get_notifications():
|
|||
- notifications: list of notifications.
|
||||
- id
|
||||
- message
|
||||
- title
|
||||
- read
|
||||
- created_at
|
||||
"""
|
||||
|
@ -48,6 +49,7 @@ def get_notifications():
|
|||
{
|
||||
"id": notification.id,
|
||||
"message": notification.message,
|
||||
"title": notification.title,
|
||||
"read": notification.read,
|
||||
"created_at": notification.created_at.humanize(),
|
||||
}
|
||||
|
|
|
@ -820,6 +820,7 @@ Output:
|
|||
- notifications: list of notification, each notification has:
|
||||
- id
|
||||
- message: the message in html
|
||||
- title: the message title
|
||||
- read: whether the user has read the notification
|
||||
- created_at: when the notification is created
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ def test_get_notifications(flask_client):
|
|||
Session.commit()
|
||||
|
||||
r = flask_client.get(
|
||||
url_for("api.get_notifications", page=0),
|
||||
"/api/notifications?page=0",
|
||||
headers={"Authentication": api_key.code},
|
||||
)
|
||||
|
||||
|
@ -30,6 +30,7 @@ def test_get_notifications(flask_client):
|
|||
for n in r.json["notifications"]:
|
||||
assert n["id"] > 0
|
||||
assert n["message"]
|
||||
assert "title" in n
|
||||
assert n["read"] is False
|
||||
assert n["created_at"]
|
||||
|
||||
|
|
Loading…
Reference in a new issue