aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Leon Sandøy <[email protected]>2020-07-29 14:10:31 +0200
committerGravatar Leon Sandøy <[email protected]>2020-07-29 14:10:31 +0200
commitb4b99c5b56833409c68b89d807c9b9f6d385e7f3 (patch)
treedf733bc9da31f93ce67ad6d2a5db022886de4ac1
parentHandle unique validator in DRF, not Django. (diff)
Add a test for checking duplicates.
-rw-r--r--pydis_site/apps/api/tests/test_filterlists.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/pydis_site/apps/api/tests/test_filterlists.py b/pydis_site/apps/api/tests/test_filterlists.py
index b577c31c..47aaaf31 100644
--- a/pydis_site/apps/api/tests/test_filterlists.py
+++ b/pydis_site/apps/api/tests/test_filterlists.py
@@ -88,6 +88,11 @@ class CreationTests(APISubdomainTestCase):
response = self.client.post(URL, data=JPEG_ALLOWLIST)
self.assertEqual(response.status_code, 201)
+ def test_returns_400_for_duplicate_creation(self):
+ self.client.post(URL, data=JPEG_ALLOWLIST)
+ response = self.client.post(URL, data=JPEG_ALLOWLIST)
+ self.assertEqual(response.status_code, 400)
+
class DeletionTests(APISubdomainTestCase):
@classmethod