From 2a551e7ab981dff422cfce6689f16418d9426850 Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 11 May 2022 17:08:12 +0200 Subject: [PATCH] Add test to replace removed coverage --- InvenTree/InvenTree/test_api.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/InvenTree/InvenTree/test_api.py b/InvenTree/InvenTree/test_api.py index 0e813d48de..9a285963aa 100644 --- a/InvenTree/InvenTree/test_api.py +++ b/InvenTree/InvenTree/test_api.py @@ -96,6 +96,13 @@ class HTMLAPITests(TestCase): response = self.client.get(url, HTTP_ACCEPT='text/html') self.assertEqual(response.status_code, 200) + def test_not_found(self): + """Test that the NotFoundView is working""" + url = reverse('api-404') + + # Check JSON response + response = self.client.get(url, HTTP_ACCEPT='application/json') + self.assertEqual(response.status_code, 404) class APITests(InvenTreeAPITestCase): """ Tests for the InvenTree API """