From fa71921fa57a456d6f3bd010952e9e5dd8c59d1d Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Thu, 25 Jun 2020 11:04:42 -0400 Subject: [PATCH] Extend DeviceComponentViewTestCase to include GetObjectViewTestCase --- netbox/dcim/tests/test_views.py | 16 +++++++++++----- netbox/utilities/testing/views.py | 1 + netbox/virtualization/tests/test_views.py | 5 +---- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/netbox/dcim/tests/test_views.py b/netbox/dcim/tests/test_views.py index 5c5e46853..079f26fdf 100644 --- a/netbox/dcim/tests/test_views.py +++ b/netbox/dcim/tests/test_views.py @@ -1194,10 +1194,7 @@ class PowerOutletTestCase(ViewTestCases.DeviceComponentViewTestCase): ) -class InterfaceTestCase( - ViewTestCases.GetObjectViewTestCase, - ViewTestCases.DeviceComponentViewTestCase, -): +class InterfaceTestCase(ViewTestCases.DeviceComponentViewTestCase): model = Interface @classmethod @@ -1425,7 +1422,16 @@ class DeviceBayTestCase(ViewTestCases.DeviceComponentViewTestCase): ) -class InventoryItemTestCase(ViewTestCases.DeviceComponentViewTestCase): +# TODO: Convert to DeviceComponentViewTestCase? +class InventoryItemTestCase( + ViewTestCases.EditObjectViewTestCase, + ViewTestCases.DeleteObjectViewTestCase, + ViewTestCases.ListObjectsViewTestCase, + ViewTestCases.BulkCreateObjectsViewTestCase, + ViewTestCases.BulkImportObjectsViewTestCase, + ViewTestCases.BulkEditObjectsViewTestCase, + ViewTestCases.BulkDeleteObjectsViewTestCase +): model = InventoryItem @classmethod diff --git a/netbox/utilities/testing/views.py b/netbox/utilities/testing/views.py index 774ceac85..2cf32616c 100644 --- a/netbox/utilities/testing/views.py +++ b/netbox/utilities/testing/views.py @@ -917,6 +917,7 @@ class ViewTestCases: maxDiff = None class DeviceComponentViewTestCase( + GetObjectViewTestCase, EditObjectViewTestCase, DeleteObjectViewTestCase, ListObjectsViewTestCase, diff --git a/netbox/virtualization/tests/test_views.py b/netbox/virtualization/tests/test_views.py index 408558779..ec4159dd4 100644 --- a/netbox/virtualization/tests/test_views.py +++ b/netbox/virtualization/tests/test_views.py @@ -189,10 +189,7 @@ class VirtualMachineTestCase(ViewTestCases.PrimaryObjectViewTestCase): } -class VMInterfaceTestCase( - ViewTestCases.GetObjectViewTestCase, - ViewTestCases.DeviceComponentViewTestCase, -): +class VMInterfaceTestCase(ViewTestCases.DeviceComponentViewTestCase): model = VMInterface @classmethod