diff options
| author | rr- | 2016-06-06 22:25:50 +0200 |
|---|---|---|
| committer | rr- | 2016-06-08 22:38:35 +0200 |
| commit | ded89fee5f5d2d9ad5392149621e968771dc805c (patch) | |
| tree | 498c20c2a559a320ea910576ef7934dcb4532916 /server/szurubooru/tests/api/test_post_retrieving.py | |
| parent | 053d1889e08dd07a68e033f5c95986daaab6dd33 (diff) | |
server/posts: fix handling bad post ID
Diffstat (limited to 'server/szurubooru/tests/api/test_post_retrieving.py')
| -rw-r--r-- | server/szurubooru/tests/api/test_post_retrieving.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/server/szurubooru/tests/api/test_post_retrieving.py b/server/szurubooru/tests/api/test_post_retrieving.py index 41c6ead..5b1c38c 100644 --- a/server/szurubooru/tests/api/test_post_retrieving.py +++ b/server/szurubooru/tests/api/test_post_retrieving.py @@ -83,16 +83,23 @@ def test_retrieving_single(test_ctx): assert 'snapshots' in result assert 'comments' in result +def test_trying_to_retrieve_invalid_id(test_ctx): + with pytest.raises(posts.InvalidPostIdError): + test_ctx.detail_api.get( + test_ctx.context_factory( + user=test_ctx.user_factory(rank=db.User.RANK_REGULAR)), + '-') + def test_trying_to_retrieve_single_non_existing(test_ctx): with pytest.raises(posts.PostNotFoundError): test_ctx.detail_api.get( test_ctx.context_factory( user=test_ctx.user_factory(rank=db.User.RANK_REGULAR)), - '-') + '999') def test_trying_to_retrieve_single_without_privileges(test_ctx): with pytest.raises(errors.AuthError): test_ctx.detail_api.get( test_ctx.context_factory( user=test_ctx.user_factory(rank=db.User.RANK_ANONYMOUS)), - '-') + '999') |