From 20f52d856b04a29c7689d8db9ee00ba915b6f081 Mon Sep 17 00:00:00 2001 From: Jon Date: Sun, 9 Feb 2025 19:32:16 +0930 Subject: [PATCH] test(itim): Cluster Note Model Checks ref: #525 closes #533 --- .../test_unit_cluster_notes_model.py | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 app/itim/tests/unit/cluster_notes/test_unit_cluster_notes_model.py diff --git a/app/itim/tests/unit/cluster_notes/test_unit_cluster_notes_model.py b/app/itim/tests/unit/cluster_notes/test_unit_cluster_notes_model.py new file mode 100644 index 00000000..d08ec645 --- /dev/null +++ b/app/itim/tests/unit/cluster_notes/test_unit_cluster_notes_model.py @@ -0,0 +1,37 @@ +from django.contrib.contenttypes.models import ContentType +from django.test import TestCase + +from core.tests.abstract.test_unit_model_notes_model import ModelNotesModel + +from itim.models.cluster_notes import ClusterNotes + + + +class ClusterNotesModel( + ModelNotesModel, + TestCase, +): + + model = ClusterNotes + + + @classmethod + def setUpTestData(self): + """Setup Test""" + + super().setUpTestData() + + + self.item = self.model.objects.create( + organization = self.organization, + content = 'a random comment for an exiting item', + content_type = ContentType.objects.get( + app_label = str(self.model._meta.app_label).lower(), + model = str(self.model.model.field.related_model.__name__).replace(' ', '').lower(), + ), + model = self.model.model.field.related_model.objects.create( + organization = self.organization, + name = 'note model existing item', + ), + created_by = self.user, + )