Просмотр исходного кода

Extend DeviceComponentViewTestCase to include GetObjectViewTestCase

Jeremy Stretch 5 лет назад
Родитель
Сommit
3badfd756c

+ 11 - 5
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
     model = Interface
 
 
     @classmethod
     @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
     model = InventoryItem
 
 
     @classmethod
     @classmethod

+ 1 - 0
netbox/utilities/testing/views.py

@@ -917,6 +917,7 @@ class ViewTestCases:
         maxDiff = None
         maxDiff = None
 
 
     class DeviceComponentViewTestCase(
     class DeviceComponentViewTestCase(
+        GetObjectViewTestCase,
         EditObjectViewTestCase,
         EditObjectViewTestCase,
         DeleteObjectViewTestCase,
         DeleteObjectViewTestCase,
         ListObjectsViewTestCase,
         ListObjectsViewTestCase,

+ 1 - 4
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
     model = VMInterface
 
 
     @classmethod
     @classmethod