diff options
author | 2021-11-22 20:38:41 +0000 | |
---|---|---|
committer | 2021-11-22 20:38:41 +0000 | |
commit | c8d1513b8f8cb21482180ce19d69a107adefe4e2 (patch) | |
tree | 4179a1a1e69d12f4b049235f641d1db06ca8da58 | |
parent | Only calc activity blocks when <1k messages (diff) |
Make metricity test order insensitive
We only actually care that thee key:value pairs are equal, the order of them isn't actually important.
The naming of `assertCountEqual` is a little misleading, since it actually tests that the first sequence contains the same elements as second, regardless of their order. See https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertCountEqual
-rw-r--r-- | pydis_site/apps/api/tests/test_users.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pydis_site/apps/api/tests/test_users.py b/pydis_site/apps/api/tests/test_users.py index 295bcf64..550c7240 100644 --- a/pydis_site/apps/api/tests/test_users.py +++ b/pydis_site/apps/api/tests/test_users.py @@ -408,7 +408,7 @@ class UserMetricityTests(AuthenticatedAPITestCase): in_guild=True, ) - def test_get_metricity_data(self): + def test_get_metricity_data_under_1k(self): # Given joined_at = "foo" total_messages = 1 @@ -421,7 +421,7 @@ class UserMetricityTests(AuthenticatedAPITestCase): # Then self.assertEqual(response.status_code, 200) - self.assertEqual(response.json(), { + self.assertCountEqual(response.json(), { "joined_at": joined_at, "total_messages": total_messages, "voice_banned": False, |