aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/api/tests
diff options
context:
space:
mode:
authorGravatar Leon Sandøy <[email protected]>2020-07-17 14:59:59 +0200
committerGravatar Leon Sandøy <[email protected]>2020-07-17 15:00:40 +0200
commit061ace4c1013abbdb5408f682c0c8401d13a59ec (patch)
tree8b05d0712cf53ea4821c6f430e0ccff5ce4ca7ca /pydis_site/apps/api/tests
parentMerge branch 'master' into whitelist_system (diff)
Add an endpoint for getting AllowDenyList types.
https://github.com/python-discord/site/issues/305
Diffstat (limited to 'pydis_site/apps/api/tests')
-rw-r--r--pydis_site/apps/api/tests/test_allowlists.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/pydis_site/apps/api/tests/test_allowlists.py b/pydis_site/apps/api/tests/test_allowlists.py
index 5aa50670..1440dc71 100644
--- a/pydis_site/apps/api/tests/test_allowlists.py
+++ b/pydis_site/apps/api/tests/test_allowlists.py
@@ -54,6 +54,14 @@ class FetchTests(APISubdomainTestCase):
self.assertEqual(response.status_code, 200)
self.assertEqual(response.json().get("content"), self.jpeg_format.content)
+ def test_returns_allow_deny_list_types(self):
+ response = self.client.get(f'{URL}/get_types')
+
+ self.assertEqual(response.status_code, 200)
+ for api_type, model_type in zip(response.json(), AllowDenyList.AllowDenyListType.choices):
+ self.assertEquals(api_type[0], model_type[0])
+ self.assertEquals(api_type[1], model_type[1])
+
class CreationTests(APISubdomainTestCase):
def test_returns_400_for_missing_params(self):