diff options
| author | rr- | 2016-06-03 21:18:17 +0200 |
|---|---|---|
| committer | rr- | 2016-06-03 21:46:25 +0200 |
| commit | caecaee7856a818cc0ee45dc45a335a3b3a25af6 (patch) | |
| tree | c556800c8ea50f849efaf020354a9e5c8aab935c /server/szurubooru/tests/api | |
| parent | aa95afb989b4caf0fc6f5de3b07907790e84da16 (diff) | |
server/users: offer more stats in user entity
Diffstat (limited to 'server/szurubooru/tests/api')
| -rw-r--r-- | server/szurubooru/tests/api/test_user_creating.py | 5 | ||||
| -rw-r--r-- | server/szurubooru/tests/api/test_user_retrieving.py | 8 | ||||
| -rw-r--r-- | server/szurubooru/tests/api/test_user_updating.py | 5 |
3 files changed, 18 insertions, 0 deletions
diff --git a/server/szurubooru/tests/api/test_user_creating.py b/server/szurubooru/tests/api/test_user_creating.py index c512b8b..e70f660 100644 --- a/server/szurubooru/tests/api/test_user_creating.py +++ b/server/szurubooru/tests/api/test_user_creating.py @@ -43,6 +43,11 @@ def test_creating_user(test_ctx, fake_datetime): 'name': 'chewie1', 'rank': 'administrator', 'email': 'asd@asd.asd', + 'commentCount': 0, + 'likedPostCount': 0, + 'dislikedPostCount': 0, + 'favoritePostCount': 0, + 'uploadedPostCount': 0, } user = users.get_user_by_name('chewie1') assert user.name == 'chewie1' diff --git a/server/szurubooru/tests/api/test_user_retrieving.py b/server/szurubooru/tests/api/test_user_retrieving.py index 4058916..e2ddce7 100644 --- a/server/szurubooru/tests/api/test_user_retrieving.py +++ b/server/szurubooru/tests/api/test_user_retrieving.py @@ -56,7 +56,15 @@ def test_retrieving_single(test_ctx): 'avatarUrl': 'http://gravatar.com/avatar/' + '275876e34cf609db118f3d84b799a790?d=retro&s=200', 'email': False, + 'commentCount': 0, + 'likedPostCount': False, + 'dislikedPostCount': False, + 'favoritePostCount': 0, + 'uploadedPostCount': 0, } + assert result['email'] is False + assert result['likedPostCount'] is False + assert result['dislikedPostCount'] is False def test_trying_to_retrieve_single_non_existing(test_ctx): with pytest.raises(users.UserNotFoundError): diff --git a/server/szurubooru/tests/api/test_user_updating.py b/server/szurubooru/tests/api/test_user_updating.py index 1e8cafa..2cb449f 100644 --- a/server/szurubooru/tests/api/test_user_updating.py +++ b/server/szurubooru/tests/api/test_user_updating.py @@ -57,6 +57,11 @@ def test_updating_user(test_ctx): 'email': 'asd@asd.asd', 'name': 'chewie', 'rank': 'moderator', + 'commentCount': 0, + 'likedPostCount': 0, + 'dislikedPostCount': 0, + 'favoritePostCount': 0, + 'uploadedPostCount': 0, } user = users.get_user_by_name('chewie') assert user.name == 'chewie' |