diff options
Diffstat (limited to 'pydis_site/apps/api/tests')
-rw-r--r-- | pydis_site/apps/api/tests/test_bumped_threads.py | 2 | ||||
-rw-r--r-- | pydis_site/apps/api/tests/test_filters.py | 7 | ||||
-rw-r--r-- | pydis_site/apps/api/tests/test_infractions.py | 2 | ||||
-rw-r--r-- | pydis_site/apps/api/tests/test_nominations.py | 4 | ||||
-rw-r--r-- | pydis_site/apps/api/tests/test_roles.py | 2 |
5 files changed, 11 insertions, 6 deletions
diff --git a/pydis_site/apps/api/tests/test_bumped_threads.py b/pydis_site/apps/api/tests/test_bumped_threads.py index 2e3892c7..72f475c6 100644 --- a/pydis_site/apps/api/tests/test_bumped_threads.py +++ b/pydis_site/apps/api/tests/test_bumped_threads.py @@ -60,4 +60,4 @@ class BumpedThreadAPITests(AuthenticatedAPITestCase): response = self.client.get(url) self.assertEqual(response.status_code, 404) - self.assertEqual(response.json(), {"detail": "Not found."}) + self.assertEqual(response.json(), {"detail": "No BumpedThread matches the given query."}) diff --git a/pydis_site/apps/api/tests/test_filters.py b/pydis_site/apps/api/tests/test_filters.py index 4cef1c8f..9771bacc 100644 --- a/pydis_site/apps/api/tests/test_filters.py +++ b/pydis_site/apps/api/tests/test_filters.py @@ -211,7 +211,12 @@ class GenericFilterTests(AuthenticatedAPITestCase): response = self.client.get(f"{sequence.url()}/42") self.assertEqual(response.status_code, 404) - self.assertDictEqual(response.json(), {'detail': 'Not found.'}) + parsed = response.json() + self.assertIn('detail', parsed) + self.assertIn(parsed['detail'], ( + "No Filter matches the given query.", + "No FilterList matches the given query." + )) def test_creation(self) -> None: for name, sequence in get_test_sequences().items(): diff --git a/pydis_site/apps/api/tests/test_infractions.py b/pydis_site/apps/api/tests/test_infractions.py index f1e54b1e..b82fb66c 100644 --- a/pydis_site/apps/api/tests/test_infractions.py +++ b/pydis_site/apps/api/tests/test_infractions.py @@ -559,7 +559,7 @@ class CreationTests(AuthenticatedAPITestCase): second_response.json(), { 'non_field_errors': [ - 'This user already has an active infraction of this type.' + 'The fields user, type must make a unique set.' ] } ) diff --git a/pydis_site/apps/api/tests/test_nominations.py b/pydis_site/apps/api/tests/test_nominations.py index e4dfe36a..7c6f1bbb 100644 --- a/pydis_site/apps/api/tests/test_nominations.py +++ b/pydis_site/apps/api/tests/test_nominations.py @@ -379,7 +379,7 @@ class NominationTests(AuthenticatedAPITestCase): response = self.client.get(url, data={}) self.assertEqual(response.status_code, 404) self.assertEqual(response.json(), { - "detail": "Not found." + "detail": "No Nomination matches the given query." }) def test_returns_404_on_patch_unknown_nomination(self): @@ -391,7 +391,7 @@ class NominationTests(AuthenticatedAPITestCase): response = self.client.patch(url, data={}) self.assertEqual(response.status_code, 404) self.assertEqual(response.json(), { - "detail": "Not found." + "detail": "No Nomination matches the given query." }) def test_returns_405_on_list_put(self): diff --git a/pydis_site/apps/api/tests/test_roles.py b/pydis_site/apps/api/tests/test_roles.py index d3031990..8ca6e7c1 100644 --- a/pydis_site/apps/api/tests/test_roles.py +++ b/pydis_site/apps/api/tests/test_roles.py @@ -208,4 +208,4 @@ class CreationTests(AuthenticatedAPITestCase): for method in ('get', 'put', 'patch', 'delete'): response = getattr(self.client, method)(url) self.assertEqual(response.status_code, 404) - self.assertJSONEqual(response.content, '{"detail": "Not found."}') + self.assertJSONEqual(response.content, '{"detail": "No Role matches the given query."}') |