From c5890b75b3ab604d79bd2e849499c75c793d89a1 Mon Sep 17 00:00:00 2001 From: purhan Date: Sat, 2 Jan 2021 15:35:18 +0530 Subject: [PATCH] [change] Add more tests to improve coverage --- openwisp_ipam/tests/test_multitenant.py | 27 +++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/openwisp_ipam/tests/test_multitenant.py b/openwisp_ipam/tests/test_multitenant.py index e45cf53..a28d054 100644 --- a/openwisp_ipam/tests/test_multitenant.py +++ b/openwisp_ipam/tests/test_multitenant.py @@ -7,6 +7,14 @@ from . import CreateModelsMixin, PostDataMixin +from openwisp_ipam.api.utils import ( + FilterByOrganization, + FilterByParent, + AuthorizeCSVImport, + FilterSerializerByOrganization, +) + + User = get_user_model() IpAddress = load_model('openwisp_ipam', 'IPAddress') Subnet = load_model('openwisp_ipam', 'Subnet') @@ -403,3 +411,22 @@ def test_browsable_api_ipaddress_list(self): ) self.assertContains(response, '10.0.0.0/24') self.assertContains(response, '10.10.0.0/24') + + def test_not_implemented_error(self): + with self.assertRaises(NotImplementedError): + FilterByOrganization.get_organization_queryset(self) + + with self.assertRaises(NotImplementedError): + FilterByParent.get_parent_queryset(self) + + with self.assertRaises(NotImplementedError): + FilterByParent.get_organization_queryset(self) + + with self.assertRaises(NotImplementedError): + AuthorizeCSVImport.get_csv_organization(self) + + with self.assertRaises(NotImplementedError): + AuthorizeCSVImport.get_user_organizations(self) + + with self.assertRaises(NotImplementedError): + FilterSerializerByOrganization.filter_fields(self) \ No newline at end of file