diff options
author | 2019-11-16 18:44:55 +0100 | |
---|---|---|
committer | 2019-11-16 18:44:55 +0100 | |
commit | f55d023edb903ce57fd8b209c76e8f918fc9eb65 (patch) | |
tree | 0440432008d48775ef750fbee6abd9d07e80c90e | |
parent | Write list test for the offensive message model (diff) |
Use direct database test intead of relying on GET
-rw-r--r-- | pydis_site/apps/api/tests/test_offensive_message.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pydis_site/apps/api/tests/test_offensive_message.py b/pydis_site/apps/api/tests/test_offensive_message.py index 26729c98..d5896714 100644 --- a/pydis_site/apps/api/tests/test_offensive_message.py +++ b/pydis_site/apps/api/tests/test_offensive_message.py @@ -127,9 +127,9 @@ class DeletionTests(APISubdomainTestCase): response = self.client.delete(url) self.assertEqual(response.status_code, 204) - url = reverse('bot:offensivemessage-list', host='api') - response = self.client.get(url) - self.assertNotIn(self.valid_offensive_message.id, response.json()) + self.assertFalse( + OffensiveMessage.objects.filter(id=self.valid_offensive_message.id).exists() + ) class NotAllowedMethodsTests(APISubdomainTestCase): |