Standardize base classes for view test cases

This commit is contained in:
Jeremy Stretch
2020-05-28 12:05:54 -04:00
parent 1752430d24
commit 2fbddad04c
5 changed files with 76 additions and 77 deletions

View File

@@ -10,17 +10,17 @@ from extras.models import ConfigContext, ObjectChange, Tag
from utilities.testing import ViewTestCases, TestCase
class TagTestCase(ViewTestCases.PrimaryObjectViewTestCase):
# TODO: Change base class to PrimaryObjectViewTestCase
class TagTestCase(
ViewTestCases.GetObjectViewTestCase,
ViewTestCases.EditObjectViewTestCase,
ViewTestCases.DeleteObjectViewTestCase,
ViewTestCases.ListObjectsViewTestCase,
ViewTestCases.BulkEditObjectsViewTestCase,
ViewTestCases.BulkDeleteObjectsViewTestCase
):
model = Tag
# Disable inapplicable tests
test_create_object_without_permission = None
test_create_object_with_model_permission = None
test_create_object_with_object_permission = None
test_bulk_import_objects_without_permission = None
test_bulk_import_objects_with_model_permission = None
test_bulk_import_objects_with_object_permission = None
@classmethod
def setUpTestData(cls):
@@ -42,22 +42,16 @@ class TagTestCase(ViewTestCases.PrimaryObjectViewTestCase):
}
class ConfigContextTestCase(ViewTestCases.PrimaryObjectViewTestCase):
# TODO: Change base class to PrimaryObjectViewTestCase
class ConfigContextTestCase(
ViewTestCases.GetObjectViewTestCase,
ViewTestCases.DeleteObjectViewTestCase,
ViewTestCases.ListObjectsViewTestCase,
ViewTestCases.BulkEditObjectsViewTestCase,
ViewTestCases.BulkDeleteObjectsViewTestCase
):
model = ConfigContext
# Disable inapplicable tests
test_bulk_import_objects_without_permission = None
test_bulk_import_objects_with_model_permission = None
test_bulk_import_objects_with_object_permission = None
# TODO: Resolve model discrepancies when creating/editing ConfigContexts
test_create_object_without_permission = None
test_create_object_with_model_permission = None
test_create_object_with_object_permission = None
test_edit_object_without_permission = None
test_edit_object_with_model_permission = None
test_edit_object_with_object_permission = None
@classmethod
def setUpTestData(cls):