chore(project_management): Remove old History Tests
ref: #783 #735 #759
This commit is contained in:
@ -1,34 +0,0 @@
|
||||
from django.test import TestCase
|
||||
|
||||
from core.tests.abstract.test_functional_history import HistoryEntriesCommon
|
||||
|
||||
from project_management.models.project_history import Project, ProjectHistory
|
||||
|
||||
|
||||
|
||||
class History(
|
||||
HistoryEntriesCommon,
|
||||
TestCase,
|
||||
):
|
||||
|
||||
model = Project
|
||||
|
||||
history_model = ProjectHistory
|
||||
|
||||
|
||||
@classmethod
|
||||
def setUpTestData(self):
|
||||
|
||||
super().setUpTestData()
|
||||
|
||||
self.obj = self.model.objects.create(
|
||||
organization = self.organization,
|
||||
name = self.field_value_original
|
||||
)
|
||||
|
||||
self.obj_delete = self.model.objects.create(
|
||||
organization = self.organization,
|
||||
name = self.field_value_delete
|
||||
)
|
||||
|
||||
self.call_the_banners()
|
@ -1,43 +0,0 @@
|
||||
from django.test import TestCase
|
||||
|
||||
from core.tests.abstract.test_functional_history import HistoryEntriesCommon
|
||||
|
||||
from project_management.models.projects import Project
|
||||
from project_management.models.project_milestone_history import ProjectMilestone, ProjectMilestoneHistory
|
||||
|
||||
|
||||
|
||||
class History(
|
||||
HistoryEntriesCommon,
|
||||
TestCase,
|
||||
):
|
||||
|
||||
model = ProjectMilestone
|
||||
|
||||
history_model = ProjectMilestoneHistory
|
||||
|
||||
|
||||
@classmethod
|
||||
def setUpTestData(self):
|
||||
|
||||
super().setUpTestData()
|
||||
|
||||
self.obj = self.model.objects.create(
|
||||
organization = self.organization,
|
||||
name = self.field_value_original,
|
||||
project = Project.objects.create(
|
||||
organization = self.organization,
|
||||
name = self.field_value_original,
|
||||
)
|
||||
)
|
||||
|
||||
self.obj_delete = self.model.objects.create(
|
||||
organization = self.organization,
|
||||
name = self.field_value_delete,
|
||||
project = Project.objects.create(
|
||||
organization = self.organization,
|
||||
name = 'proj two',
|
||||
)
|
||||
)
|
||||
|
||||
self.call_the_banners()
|
@ -1,34 +0,0 @@
|
||||
from django.test import TestCase
|
||||
|
||||
from core.tests.abstract.test_functional_history import HistoryEntriesCommon
|
||||
|
||||
from project_management.models.project_state_history import ProjectState, ProjectStateHistory
|
||||
|
||||
|
||||
|
||||
class History(
|
||||
HistoryEntriesCommon,
|
||||
TestCase,
|
||||
):
|
||||
|
||||
model = ProjectState
|
||||
|
||||
history_model = ProjectStateHistory
|
||||
|
||||
|
||||
@classmethod
|
||||
def setUpTestData(self):
|
||||
|
||||
super().setUpTestData()
|
||||
|
||||
self.obj = self.model.objects.create(
|
||||
organization = self.organization,
|
||||
name = self.field_value_original
|
||||
)
|
||||
|
||||
self.obj_delete = self.model.objects.create(
|
||||
organization = self.organization,
|
||||
name = self.field_value_delete
|
||||
)
|
||||
|
||||
self.call_the_banners()
|
@ -1,34 +0,0 @@
|
||||
from django.test import TestCase
|
||||
|
||||
from core.tests.abstract.test_functional_history import HistoryEntriesCommon
|
||||
|
||||
from project_management.models.project_type_history import ProjectType, ProjectTypeHistory
|
||||
|
||||
|
||||
|
||||
class History(
|
||||
HistoryEntriesCommon,
|
||||
TestCase,
|
||||
):
|
||||
|
||||
model = ProjectType
|
||||
|
||||
history_model = ProjectTypeHistory
|
||||
|
||||
|
||||
@classmethod
|
||||
def setUpTestData(self):
|
||||
|
||||
super().setUpTestData()
|
||||
|
||||
self.obj = self.model.objects.create(
|
||||
organization = self.organization,
|
||||
name = self.field_value_original
|
||||
)
|
||||
|
||||
self.obj_delete = self.model.objects.create(
|
||||
organization = self.organization,
|
||||
name = self.field_value_delete
|
||||
)
|
||||
|
||||
self.call_the_banners()
|
@ -1,43 +0,0 @@
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.test import TestCase
|
||||
|
||||
from project_management.models.project_history import Project, ProjectHistory
|
||||
from core.tests.abstract.test_unit_model_history_api_v2 import PrimaryModelHistoryAPI
|
||||
|
||||
|
||||
|
||||
class ModelHistoryAPI(
|
||||
PrimaryModelHistoryAPI,
|
||||
TestCase,
|
||||
):
|
||||
|
||||
audit_model = Project
|
||||
|
||||
model = ProjectHistory
|
||||
|
||||
@classmethod
|
||||
def setUpTestData(self):
|
||||
|
||||
super().setUpTestData()
|
||||
|
||||
self.audit_object = self.audit_model.objects.create(
|
||||
organization = self.organization,
|
||||
name = 'one',
|
||||
)
|
||||
|
||||
|
||||
self.history_entry = self.model.objects.create(
|
||||
organization = self.audit_object.organization,
|
||||
action = self.model.Actions.ADD,
|
||||
user = self.view_user,
|
||||
before = {},
|
||||
after = {},
|
||||
content_type = ContentType.objects.get(
|
||||
app_label = self.audit_object._meta.app_label,
|
||||
model = self.audit_object._meta.model_name,
|
||||
),
|
||||
model = self.audit_object,
|
||||
)
|
||||
|
||||
|
||||
self.make_request()
|
@ -1,52 +0,0 @@
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.test import TestCase
|
||||
|
||||
from core.tests.abstract.test_unit_model_history_api_v2 import PrimaryModelHistoryAPI
|
||||
|
||||
from project_management.models.projects import Project
|
||||
from project_management.models.project_milestone_history import ProjectMilestone, ProjectMilestoneHistory
|
||||
|
||||
|
||||
|
||||
class ModelHistoryAPI(
|
||||
PrimaryModelHistoryAPI,
|
||||
TestCase,
|
||||
):
|
||||
|
||||
audit_model = ProjectMilestone
|
||||
|
||||
# audit_model_child =
|
||||
|
||||
model = ProjectMilestoneHistory
|
||||
|
||||
@classmethod
|
||||
def setUpTestData(self):
|
||||
|
||||
super().setUpTestData()
|
||||
|
||||
|
||||
self.audit_object = self.audit_model.objects.create(
|
||||
organization = self.organization,
|
||||
project = Project.objects.create(
|
||||
organization = self.organization,
|
||||
name = 'one',
|
||||
),
|
||||
name = 'proj',
|
||||
)
|
||||
|
||||
|
||||
self.history_entry = self.model.objects.create(
|
||||
organization = self.audit_object.organization,
|
||||
action = self.model.Actions.ADD,
|
||||
user = self.view_user,
|
||||
before = {},
|
||||
after = {},
|
||||
content_type = ContentType.objects.get(
|
||||
app_label = self.audit_object._meta.app_label,
|
||||
model = self.audit_object._meta.model_name,
|
||||
),
|
||||
model = self.audit_object,
|
||||
)
|
||||
|
||||
|
||||
self.make_request()
|
@ -1,43 +0,0 @@
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.test import TestCase
|
||||
|
||||
from project_management.models.project_state_history import ProjectState, ProjectStateHistory
|
||||
from core.tests.abstract.test_unit_model_history_api_v2 import PrimaryModelHistoryAPI
|
||||
|
||||
|
||||
|
||||
class ModelHistoryAPI(
|
||||
PrimaryModelHistoryAPI,
|
||||
TestCase,
|
||||
):
|
||||
|
||||
audit_model = ProjectState
|
||||
|
||||
model = ProjectStateHistory
|
||||
|
||||
@classmethod
|
||||
def setUpTestData(self):
|
||||
|
||||
super().setUpTestData()
|
||||
|
||||
self.audit_object = self.audit_model.objects.create(
|
||||
organization = self.organization,
|
||||
name = 'one',
|
||||
)
|
||||
|
||||
|
||||
self.history_entry = self.model.objects.create(
|
||||
organization = self.audit_object.organization,
|
||||
action = self.model.Actions.ADD,
|
||||
user = self.view_user,
|
||||
before = {},
|
||||
after = {},
|
||||
content_type = ContentType.objects.get(
|
||||
app_label = self.audit_object._meta.app_label,
|
||||
model = self.audit_object._meta.model_name,
|
||||
),
|
||||
model = self.audit_object,
|
||||
)
|
||||
|
||||
|
||||
self.make_request()
|
@ -1,43 +0,0 @@
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.test import TestCase
|
||||
|
||||
from project_management.models.project_type_history import ProjectType, ProjectTypeHistory
|
||||
from core.tests.abstract.test_unit_model_history_api_v2 import PrimaryModelHistoryAPI
|
||||
|
||||
|
||||
|
||||
class ModelHistoryAPI(
|
||||
PrimaryModelHistoryAPI,
|
||||
TestCase,
|
||||
):
|
||||
|
||||
audit_model = ProjectType
|
||||
|
||||
model = ProjectTypeHistory
|
||||
|
||||
@classmethod
|
||||
def setUpTestData(self):
|
||||
|
||||
super().setUpTestData()
|
||||
|
||||
self.audit_object = self.audit_model.objects.create(
|
||||
organization = self.organization,
|
||||
name = 'one',
|
||||
)
|
||||
|
||||
|
||||
self.history_entry = self.model.objects.create(
|
||||
organization = self.audit_object.organization,
|
||||
action = self.model.Actions.ADD,
|
||||
user = self.view_user,
|
||||
before = {},
|
||||
after = {},
|
||||
content_type = ContentType.objects.get(
|
||||
app_label = self.audit_object._meta.app_label,
|
||||
model = self.audit_object._meta.model_name,
|
||||
),
|
||||
model = self.audit_object,
|
||||
)
|
||||
|
||||
|
||||
self.make_request()
|
Reference in New Issue
Block a user