aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/api/tests
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2021-11-22 20:38:58 +0000
committerGravatar Chris Lovering <[email protected]>2021-11-22 20:38:58 +0000
commit78b2f3b8ed46d23015ab2f765504572f672f4567 (patch)
treef7f0355bd539a9bdd9622c6de9877d0949fc3aeb /pydis_site/apps/api/tests
parentMake metricity test order insensitive (diff)
Add metricity test for users >1k messages
Diffstat (limited to 'pydis_site/apps/api/tests')
-rw-r--r--pydis_site/apps/api/tests/test_users.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/pydis_site/apps/api/tests/test_users.py b/pydis_site/apps/api/tests/test_users.py
index 550c7240..81bfd43b 100644
--- a/pydis_site/apps/api/tests/test_users.py
+++ b/pydis_site/apps/api/tests/test_users.py
@@ -428,6 +428,25 @@ class UserMetricityTests(AuthenticatedAPITestCase):
"activity_blocks": total_blocks
})
+ def test_get_metricity_data_over_1k(self):
+ # Given
+ joined_at = "foo"
+ total_messages = 1001
+ total_blocks = 1001
+ self.mock_metricity_user(joined_at, total_messages, total_blocks, [])
+
+ # When
+ url = reverse('api:bot:user-metricity-data', args=[0])
+ response = self.client.get(url)
+
+ # Then
+ self.assertEqual(response.status_code, 200)
+ self.assertCountEqual(response.json(), {
+ "joined_at": joined_at,
+ "total_messages": total_messages,
+ "voice_banned": False,
+ })
+
def test_no_metricity_user(self):
# Given
self.mock_no_metricity_user()