From d7df6e42b62767b49629087e398fbec62f4fe74c Mon Sep 17 00:00:00 2001 From: Kevin Schoonover Date: Sat, 31 Mar 2018 00:59:18 +0000 Subject: [PATCH] Fix failed test case due to running the generic case --- ACM_General/rest_api/tests.py | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/ACM_General/rest_api/tests.py b/ACM_General/rest_api/tests.py index be04f50..43cafa6 100644 --- a/ACM_General/rest_api/tests.py +++ b/ACM_General/rest_api/tests.py @@ -347,7 +347,7 @@ def acquire_permissions(self): """ self.client.force_login(self.default_user) - def test_rest_actions(self): + def assert_generic_rest_actions(self): """ Ensures that the rest actions for the model specified in the class returns the proper results for the GET, POST, PUT, and DELETE methods. @@ -363,7 +363,7 @@ def test_rest_actions(self): data, mod_data, self.model, self.content_type ) - def test_rest_actions_without_permissions(self): + def assert_rest_actions_without_permissions(self): """ Ensures that the rest actions for the model specified in the class fails if the user does not have the proper permissions. @@ -429,7 +429,10 @@ def test_serializer_validation(self): self.assertEqual(response.status_code, 400) def test_rest_actions(self): - super().test_rest_actions() + self.assert_generic_rest_actions() + + def test_rest_actions_without_permissions(self): + self.assert_rest_actions_without_permissions() class EventsTestCase(RestAPITestCase): @@ -466,7 +469,10 @@ def setUp(self): self.content_type = "multipart/form-data" def test_rest_actions(self): - super().test_rest_actions() + self.assert_generic_rest_actions() + + def test_rest_actions_without_permissions(self): + self.assert_rest_actions_without_permissions() class SigsTestCase(RestAPITestCase): @@ -501,7 +507,10 @@ def setUp(self): self.content_type = "application/json" def test_rest_actions(self): - super().test_rest_actions() + self.assert_generic_rest_actions() + + def test_rest_actions_without_permissions(self): + self.assert_rest_actions_without_permissions() class TransactionsTestCase(RestAPITestCase): @@ -547,7 +556,10 @@ def setUp(self): self.content_type = "application/json" def test_rest_actions(self): - super().test_rest_actions() + self.assert_generic_rest_actions() + + def test_rest_actions_without_permissions(self): + self.assert_rest_actions_without_permissions() class CategoryTestCase(RestAPITestCase): @@ -576,7 +588,10 @@ def setUp(self): self.content_type = "application/json" def test_rest_actions(self): - super().test_rest_actions() + self.assert_generic_rest_actions() + + def test_rest_actions_without_permissions(self): + self.assert_rest_actions_without_permissions() class ProductTestCase(RestAPITestCase): @@ -614,4 +629,7 @@ def setUp(self): self.content_type = "application/json" def test_rest_actions(self): - super().test_rest_actions() + self.assert_generic_rest_actions() + + def test_rest_actions_without_permissions(self): + self.assert_rest_actions_without_permissions()