From b4b99c5b56833409c68b89d807c9b9f6d385e7f3 Mon Sep 17 00:00:00 2001 From: Leon Sandøy Date: Wed, 29 Jul 2020 14:10:31 +0200 Subject: Add a test for checking duplicates. --- pydis_site/apps/api/tests/test_filterlists.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pydis_site') 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 -- cgit v1.2.3