diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/data.sql | 2 | ||||
| -rw-r--r-- | tests/test_users.py | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/tests/data.sql b/tests/data.sql index 5add3a2..5e6ddde 100644 --- a/tests/data.sql +++ b/tests/data.sql @@ -3,7 +3,7 @@ values ('test', 'pbkdf2:sha256:50000$TCI4GzcX$0de171a4f4dac32e3364c7ddc7c14f3e2fa61f2d17574483f7ffbb431b4acb2f', 40), ('other', 'pbkdf2:sha256:50000$kJPKsz6N$d2d4784f1b030a9761f5ccaeeaca413f27f2ecb76d6168407af962ddce849f79', 0); -insert into inbox (recipient, ap_content, received) +insert into inbox (recipient, content_id, received) values ('test', '1', '2021-07-09T11:21:58+0000'), ('test', '2', '2021-07-09T11:21:58+0000'), diff --git a/tests/test_users.py b/tests/test_users.py index e75492a..c3c2373 100644 --- a/tests/test_users.py +++ b/tests/test_users.py @@ -62,6 +62,19 @@ def test_get_user_inbox_page_authorised(app, client, auth): ) +def test_get_user_inbox_page_correct_itemisation(app, client, auth): + with app.app_context(): + inbox_id = url_for("users.get_user_inbox", username="test") + auth.login() + inbox = client.get(inbox_id).json + page_id = inbox["first"] + items = client.get(page_id).json["items"] + + assert items + assert len(items) > 0 + assert all([("id" in item or isinstance(item, str)) for item in items]) + + def test_get_user_inbox_page_after_logout(app, client, auth): with app.app_context(): inbox_id = url_for("users.get_user_inbox", username="test") |
