test(itim): Correct test case for ticket category returned serializer checks

ref: #248 #359
This commit is contained in:
2024-11-27 21:52:11 +09:30
parent 4db65bcbad
commit 3d980de05c
5 changed files with 39 additions and 0 deletions

View File

@ -42,6 +42,8 @@ class ViewSetBase:
different_organization = Organization.objects.create(name='test_different_organization')
self.different_organization = different_organization
view_permissions = Permission.objects.get(
codename = 'view_' + self.model._meta.model_name,
@ -125,6 +127,11 @@ class ViewSetBase:
name = 'one-add'
)
self.other_org_item = self.model.objects.create(
organization = self.different_organization,
name = 'two-add'
)
self.url_view_kwargs = {'pk': self.item.id}

View File

@ -42,6 +42,8 @@ class ViewSetBase:
different_organization = Organization.objects.create(name='test_different_organization')
self.different_organization = different_organization
view_permissions = Permission.objects.get(
codename = 'view_' + self.model._meta.model_name,
@ -126,6 +128,12 @@ class ViewSetBase:
)
self.other_org_item = self.model.objects.create(
organization = self.different_organization,
name = 'two-add'
)
self.url_view_kwargs = {'pk': self.item.id}
self.add_data = {

View File

@ -42,6 +42,8 @@ class ViewSetBase:
different_organization = Organization.objects.create(name='test_different_organization')
self.different_organization = different_organization
view_permissions = Permission.objects.get(
codename = 'view_' + self.model._meta.model_name,
@ -126,6 +128,12 @@ class ViewSetBase:
protocol = Port.Protocol.TCP
)
self.other_org_item = self.model.objects.create(
organization = self.different_organization,
number = 81,
protocol = Port.Protocol.TCP
)
self.url_view_kwargs = {'pk': self.item.id}

View File

@ -47,6 +47,13 @@ class ServiceNotePermissionsAPI(
service = self.note_item
)
self.other_org_item = Notes.objects.create(
organization = self.different_organization,
note = 'b note',
usercreated = self.view_user,
service = self.note_item
)
self.url_kwargs = {'service_id': self.note_item.id}

View File

@ -44,6 +44,8 @@ class ViewSetBase:
different_organization = Organization.objects.create(name='test_different_organization')
self.different_organization = different_organization
view_permissions = Permission.objects.get(
codename = 'view_' + self.model._meta.model_name,
@ -139,6 +141,13 @@ class ViewSetBase:
config_key_variable = 'value'
)
self.other_org_item = self.model.objects.create(
organization=different_organization,
name = 'os name b',
device = device,
config_key_variable = 'values'
)
self.item.port.set([ port ])