-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(project_management): API Field Checks for Project Type History
- Loading branch information
Showing
2 changed files
with
43 additions
and
74 deletions.
There are no files selected for viewing
74 changes: 0 additions & 74 deletions
74
app/project_management/tests/unit/project_type/test_project_type_core_history.py
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
app/project_management/tests/unit/project_type/test_unit_project_type_history_api_v2.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
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() |