|
@@ -2395,6 +2395,7 @@ class ModuleBayTypeTestCase(ViewTestCases.PrimaryObjectViewTestCase):
|
|
|
|
|
|
|
|
class ConsolePortTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCase):
|
|
class ConsolePortTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCase):
|
|
|
model = ConsolePortTemplate
|
|
model = ConsolePortTemplate
|
|
|
|
|
+ bulk_create_permissions = ('dcim.view_devicetype',)
|
|
|
validation_excluded_fields = ('name', 'label')
|
|
validation_excluded_fields = ('name', 'label')
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
@@ -2428,6 +2429,7 @@ class ConsolePortTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestC
|
|
|
|
|
|
|
|
class ConsoleServerPortTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCase):
|
|
class ConsoleServerPortTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCase):
|
|
|
model = ConsoleServerPortTemplate
|
|
model = ConsoleServerPortTemplate
|
|
|
|
|
+ bulk_create_permissions = ('dcim.view_devicetype',)
|
|
|
validation_excluded_fields = ('name', 'label')
|
|
validation_excluded_fields = ('name', 'label')
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
@@ -2460,6 +2462,7 @@ class ConsoleServerPortTemplateTestCase(ViewTestCases.DeviceComponentTemplateVie
|
|
|
|
|
|
|
|
class PowerPortTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCase):
|
|
class PowerPortTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCase):
|
|
|
model = PowerPortTemplate
|
|
model = PowerPortTemplate
|
|
|
|
|
+ bulk_create_permissions = ('dcim.view_devicetype',)
|
|
|
validation_excluded_fields = ('name', 'label')
|
|
validation_excluded_fields = ('name', 'label')
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
@@ -2498,6 +2501,7 @@ class PowerPortTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCas
|
|
|
|
|
|
|
|
class PowerOutletTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCase):
|
|
class PowerOutletTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCase):
|
|
|
model = PowerOutletTemplate
|
|
model = PowerOutletTemplate
|
|
|
|
|
+ bulk_create_permissions = ('dcim.view_devicetype', 'dcim.view_powerporttemplate')
|
|
|
validation_excluded_fields = ('name', 'label')
|
|
validation_excluded_fields = ('name', 'label')
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
@@ -2540,6 +2544,7 @@ class PowerOutletTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestC
|
|
|
|
|
|
|
|
class InterfaceTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCase):
|
|
class InterfaceTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCase):
|
|
|
model = InterfaceTemplate
|
|
model = InterfaceTemplate
|
|
|
|
|
+ bulk_create_permissions = ('dcim.view_devicetype',)
|
|
|
validation_excluded_fields = ('name', 'label')
|
|
validation_excluded_fields = ('name', 'label')
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
@@ -2580,7 +2585,7 @@ class InterfaceTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCas
|
|
|
module_type = ModuleType.objects.create(manufacturer=device_type.manufacturer, model='Module Type 1')
|
|
module_type = ModuleType.objects.create(manufacturer=device_type.manufacturer, model='Module Type 1')
|
|
|
return_url = reverse('dcim:moduletype_interfaces', kwargs={'pk': module_type.pk})
|
|
return_url = reverse('dcim:moduletype_interfaces', kwargs={'pk': module_type.pk})
|
|
|
|
|
|
|
|
- self.add_permissions('dcim.add_interfacetemplate')
|
|
|
|
|
|
|
+ self.add_permissions('dcim.add_interfacetemplate', 'dcim.view_moduletype')
|
|
|
|
|
|
|
|
response = self.client.post(
|
|
response = self.client.post(
|
|
|
f"{self._get_url('add')}?device_type={device_type.pk}&return_url={return_url}",
|
|
f"{self._get_url('add')}?device_type={device_type.pk}&return_url={return_url}",
|
|
@@ -2602,6 +2607,7 @@ class InterfaceTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCas
|
|
|
|
|
|
|
|
class FrontPortTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCase):
|
|
class FrontPortTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCase):
|
|
|
model = FrontPortTemplate
|
|
model = FrontPortTemplate
|
|
|
|
|
+ bulk_create_permissions = ('dcim.view_devicetype', 'dcim.view_rearporttemplate')
|
|
|
validation_excluded_fields = ('name', 'label', 'rear_port')
|
|
validation_excluded_fields = ('name', 'label', 'rear_port')
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
@@ -2653,6 +2659,7 @@ class FrontPortTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCas
|
|
|
|
|
|
|
|
class RearPortTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCase):
|
|
class RearPortTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCase):
|
|
|
model = RearPortTemplate
|
|
model = RearPortTemplate
|
|
|
|
|
+ bulk_create_permissions = ('dcim.view_devicetype',)
|
|
|
validation_excluded_fields = ('name', 'label')
|
|
validation_excluded_fields = ('name', 'label')
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
@@ -2687,6 +2694,7 @@ class RearPortTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCase
|
|
|
|
|
|
|
|
class ModuleBayTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCase):
|
|
class ModuleBayTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCase):
|
|
|
model = ModuleBayTemplate
|
|
model = ModuleBayTemplate
|
|
|
|
|
+ bulk_create_permissions = ('dcim.view_devicetype',)
|
|
|
validation_excluded_fields = ('name', 'label')
|
|
validation_excluded_fields = ('name', 'label')
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
@@ -2768,6 +2776,7 @@ class ModuleBayTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCas
|
|
|
|
|
|
|
|
class DeviceBayTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCase):
|
|
class DeviceBayTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCase):
|
|
|
model = DeviceBayTemplate
|
|
model = DeviceBayTemplate
|
|
|
|
|
+ bulk_create_permissions = ('dcim.view_devicetype',)
|
|
|
validation_excluded_fields = ('name', 'label')
|
|
validation_excluded_fields = ('name', 'label')
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
@@ -2803,6 +2812,7 @@ class DeviceBayTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCas
|
|
|
|
|
|
|
|
class InventoryItemTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCase):
|
|
class InventoryItemTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCase):
|
|
|
model = InventoryItemTemplate
|
|
model = InventoryItemTemplate
|
|
|
|
|
+ bulk_create_permissions = ('dcim.view_devicetype', 'dcim.view_manufacturer')
|
|
|
validation_excluded_fields = ('name', 'label')
|
|
validation_excluded_fields = ('name', 'label')
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
@@ -3718,6 +3728,7 @@ class ModuleTestCase(
|
|
|
|
|
|
|
|
class ConsolePortTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
class ConsolePortTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
|
model = ConsolePort
|
|
model = ConsolePort
|
|
|
|
|
+ bulk_create_permissions = ('dcim.view_device', 'extras.view_tag')
|
|
|
validation_excluded_fields = ('name', 'label')
|
|
validation_excluded_fields = ('name', 'label')
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
@@ -3834,6 +3845,7 @@ class ConsolePortTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
|
|
|
|
|
|
class ConsoleServerPortTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
class ConsoleServerPortTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
|
model = ConsoleServerPort
|
|
model = ConsoleServerPort
|
|
|
|
|
+ bulk_create_permissions = ('dcim.view_device', 'extras.view_tag')
|
|
|
validation_excluded_fields = ('name', 'label')
|
|
validation_excluded_fields = ('name', 'label')
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
@@ -3904,6 +3916,7 @@ class ConsoleServerPortTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
|
|
|
|
|
|
class PowerPortTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
class PowerPortTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
|
model = PowerPort
|
|
model = PowerPort
|
|
|
|
|
+ bulk_create_permissions = ('dcim.view_device', 'extras.view_tag')
|
|
|
validation_excluded_fields = ('name', 'label')
|
|
validation_excluded_fields = ('name', 'label')
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
@@ -3980,6 +3993,7 @@ class PowerPortTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
|
|
|
|
|
|
class PowerOutletTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
class PowerOutletTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
|
model = PowerOutlet
|
|
model = PowerOutlet
|
|
|
|
|
+ bulk_create_permissions = ('dcim.view_device', 'dcim.view_powerport', 'extras.view_tag', 'users.view_owner')
|
|
|
validation_excluded_fields = ('name', 'label')
|
|
validation_excluded_fields = ('name', 'label')
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
@@ -4066,6 +4080,10 @@ class PowerOutletTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
|
|
|
|
|
|
class InterfaceTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
class InterfaceTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
|
model = Interface
|
|
model = Interface
|
|
|
|
|
+ bulk_create_permissions = (
|
|
|
|
|
+ 'dcim.view_device', 'dcim.view_interface', 'extras.view_tag', 'ipam.view_vlan', 'ipam.view_vrf',
|
|
|
|
|
+ 'wireless.view_wirelesslan',
|
|
|
|
|
+ )
|
|
|
validation_excluded_fields = ('name', 'label')
|
|
validation_excluded_fields = ('name', 'label')
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
@@ -4284,6 +4302,49 @@ class InterfaceTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
|
[visible_device.pk]
|
|
[visible_device.pk]
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
+ @tag('regression') # Issue #23585
|
|
|
|
|
+ def test_add_interface_excludes_restricted_devices(self):
|
|
|
|
|
+ """
|
|
|
|
|
+ The interface form only displays and accepts devices the user can view.
|
|
|
|
|
+ """
|
|
|
|
|
+ visible_device = Device.objects.get(name='Device 1')
|
|
|
|
|
+ site = Site.objects.create(name='Site 2', slug='site-2')
|
|
|
|
|
+ hidden_device = create_test_device('Hidden Device', site=site)
|
|
|
|
|
+
|
|
|
|
|
+ obj_perm = ObjectPermission(
|
|
|
|
|
+ name='Test permission',
|
|
|
|
|
+ actions=['view'],
|
|
|
|
|
+ constraints={'site__slug': 'site-1'},
|
|
|
|
|
+ )
|
|
|
|
|
+ obj_perm.save()
|
|
|
|
|
+ obj_perm.users.add(self.user)
|
|
|
|
|
+ obj_perm.object_types.add(ObjectType.objects.get_for_model(Device))
|
|
|
|
|
+ self.add_permissions('dcim.add_interface')
|
|
|
|
|
+ url = reverse('dcim:interface_add')
|
|
|
|
|
+ data = {
|
|
|
|
|
+ 'device': hidden_device.pk,
|
|
|
|
|
+ 'name': 'Restricted Interface',
|
|
|
|
|
+ 'type': InterfaceTypeChoices.TYPE_1GE_FIXED,
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ # Creation rejects the hidden device
|
|
|
|
|
+ response = self.client.post(url, data=post_data(data))
|
|
|
|
|
+ self.assertHttpStatus(response, 200)
|
|
|
|
|
+ self.assertIn('device', response.context['form'].errors)
|
|
|
|
|
+ self.assertNotContains(response, hidden_device.name)
|
|
|
|
|
+ self.assertFalse(Interface.objects.filter(name='Restricted Interface').exists())
|
|
|
|
|
+
|
|
|
|
|
+ # The form does not display the hidden device
|
|
|
|
|
+ response = self.client.get(url, {'device': hidden_device.pk})
|
|
|
|
|
+ self.assertHttpStatus(response, 200)
|
|
|
|
|
+ self.assertNotContains(response, hidden_device.name)
|
|
|
|
|
+
|
|
|
|
|
+ # A visible device is accepted
|
|
|
|
|
+ data['device'] = visible_device.pk
|
|
|
|
|
+ response = self.client.post(url, data=post_data(data))
|
|
|
|
|
+ self.assertHttpStatus(response, 302)
|
|
|
|
|
+ self.assertTrue(Interface.objects.filter(device=visible_device, name='Restricted Interface').exists())
|
|
|
|
|
+
|
|
|
def test_rename_select_all_spans_pages(self):
|
|
def test_rename_select_all_spans_pages(self):
|
|
|
"""
|
|
"""
|
|
|
Tests the bulk rename functionality for interfaces spanning multiple pages in the UI.
|
|
Tests the bulk rename functionality for interfaces spanning multiple pages in the UI.
|
|
@@ -4328,7 +4389,10 @@ class InterfaceTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
|
Submitting the Interface form with a mac_address string creates a MACAddress
|
|
Submitting the Interface form with a mac_address string creates a MACAddress
|
|
|
and sets it as primary in one request.
|
|
and sets it as primary in one request.
|
|
|
"""
|
|
"""
|
|
|
- self.add_permissions('dcim.add_interface', 'dcim.add_macaddress')
|
|
|
|
|
|
|
+ self.add_permissions(
|
|
|
|
|
+ 'dcim.add_interface', 'dcim.add_macaddress', 'dcim.view_device', 'dcim.view_interface', 'extras.view_tag',
|
|
|
|
|
+ 'ipam.view_vlan', 'ipam.view_vrf', 'wireless.view_wirelesslan',
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
data = {**self.form_data, 'mac_address': 'AA:BB:CC:DD:EE:FF', 'changelog_message': 'test'}
|
|
data = {**self.form_data, 'mac_address': 'AA:BB:CC:DD:EE:FF', 'changelog_message': 'test'}
|
|
|
response = self.client.post(self._get_url('add'), data=post_data(data))
|
|
response = self.client.post(self._get_url('add'), data=post_data(data))
|
|
@@ -4478,6 +4542,7 @@ class InterfaceTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
|
|
|
|
|
|
class FrontPortTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
class FrontPortTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
|
model = FrontPort
|
|
model = FrontPort
|
|
|
|
|
+ bulk_create_permissions = ('dcim.view_device', 'dcim.view_rearport', 'extras.view_tag')
|
|
|
validation_excluded_fields = ('name', 'label', 'rear_port')
|
|
validation_excluded_fields = ('name', 'label', 'rear_port')
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
@@ -4600,7 +4665,7 @@ class FrontPortTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
|
RearPort(device=device, name='Rear Port 8', positions=2),
|
|
RearPort(device=device, name='Rear Port 8', positions=2),
|
|
|
)
|
|
)
|
|
|
RearPort.objects.bulk_create(rear_ports)
|
|
RearPort.objects.bulk_create(rear_ports)
|
|
|
- self.add_permissions('dcim.add_frontport')
|
|
|
|
|
|
|
+ self.add_permissions('dcim.add_frontport', 'dcim.view_device', 'dcim.view_rearport')
|
|
|
|
|
|
|
|
response = self.client.post(self._get_url('add'), post_data({
|
|
response = self.client.post(self._get_url('add'), post_data({
|
|
|
'device': device.pk,
|
|
'device': device.pk,
|
|
@@ -4627,6 +4692,50 @@ class FrontPortTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
|
[(1, rear_port.pk, 1), (2, rear_port.pk, 2)]
|
|
[(1, rear_port.pk, 1), (2, rear_port.pk, 2)]
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
+ @tag('regression') # Issue #23585
|
|
|
|
|
+ def test_add_front_port_excludes_restricted_rear_ports(self):
|
|
|
|
|
+ """
|
|
|
|
|
+ The front port form only offers and accepts rear ports the user can view.
|
|
|
|
|
+ """
|
|
|
|
|
+ device = Device.objects.get(name='Device 1')
|
|
|
|
|
+ visible_rear_port = RearPort.objects.create(device=device, name='Visible Rear Port')
|
|
|
|
|
+ hidden_rear_port = RearPort.objects.create(device=device, name='Hidden Rear Port')
|
|
|
|
|
+
|
|
|
|
|
+ obj_perm = ObjectPermission(
|
|
|
|
|
+ name='Test permission',
|
|
|
|
|
+ actions=['view'],
|
|
|
|
|
+ constraints={'pk': visible_rear_port.pk},
|
|
|
|
|
+ )
|
|
|
|
|
+ obj_perm.save()
|
|
|
|
|
+ obj_perm.users.add(self.user)
|
|
|
|
|
+ obj_perm.object_types.add(ObjectType.objects.get_for_model(RearPort))
|
|
|
|
|
+ self.add_permissions('dcim.add_frontport', 'dcim.view_device')
|
|
|
|
|
+ url = reverse('dcim:frontport_add')
|
|
|
|
|
+ data = {
|
|
|
|
|
+ 'device': device.pk,
|
|
|
|
|
+ 'name': 'Restricted Front Port',
|
|
|
|
|
+ 'type': PortTypeChoices.TYPE_8P8C,
|
|
|
|
|
+ 'positions': 1,
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ # Creation rejects the hidden rear port
|
|
|
|
|
+ response = self.client.post(url, data=post_data({**data, 'rear_ports': [f'{hidden_rear_port.pk}:1']}))
|
|
|
|
|
+ self.assertHttpStatus(response, 200)
|
|
|
|
|
+ self.assertIn('rear_ports', response.context['form'].errors)
|
|
|
|
|
+ self.assertFalse(FrontPort.objects.filter(name='Restricted Front Port').exists())
|
|
|
|
|
+
|
|
|
|
|
+ # The form offers only the visible rear port
|
|
|
|
|
+ response = self.client.get(url, {'device': device.pk})
|
|
|
|
|
+ self.assertContains(response, visible_rear_port.name)
|
|
|
|
|
+ self.assertNotContains(response, hidden_rear_port.name)
|
|
|
|
|
+
|
|
|
|
|
+ # A visible rear port is accepted
|
|
|
|
|
+ response = self.client.post(url, data=post_data({**data, 'rear_ports': [f'{visible_rear_port.pk}:1']}))
|
|
|
|
|
+ self.assertHttpStatus(response, 302)
|
|
|
|
|
+ self.assertTrue(
|
|
|
|
|
+ PortMapping.objects.filter(front_port__name='Restricted Front Port', rear_port=visible_rear_port).exists()
|
|
|
|
|
+ )
|
|
|
|
|
+
|
|
|
def test_trace(self):
|
|
def test_trace(self):
|
|
|
self.add_permissions(
|
|
self.add_permissions(
|
|
|
'dcim.view_frontport',
|
|
'dcim.view_frontport',
|
|
@@ -4648,6 +4757,7 @@ class FrontPortTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
|
|
|
|
|
|
class RearPortTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
class RearPortTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
|
model = RearPort
|
|
model = RearPort
|
|
|
|
|
+ bulk_create_permissions = ('dcim.view_device', 'extras.view_tag')
|
|
|
validation_excluded_fields = ('name', 'label')
|
|
validation_excluded_fields = ('name', 'label')
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
@@ -4721,6 +4831,7 @@ class RearPortTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
|
|
|
|
|
|
class ModuleBayTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
class ModuleBayTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
|
model = ModuleBay
|
|
model = ModuleBay
|
|
|
|
|
+ bulk_create_permissions = ('dcim.view_device', 'extras.view_tag')
|
|
|
validation_excluded_fields = ('name', 'label')
|
|
validation_excluded_fields = ('name', 'label')
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
@@ -4874,6 +4985,7 @@ class ModuleBayTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
|
|
|
|
|
|
class DeviceBayTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
class DeviceBayTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
|
model = DeviceBay
|
|
model = DeviceBay
|
|
|
|
|
+ bulk_create_permissions = ('dcim.view_device', 'extras.view_tag')
|
|
|
validation_excluded_fields = ('name', 'label')
|
|
validation_excluded_fields = ('name', 'label')
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
@@ -4927,6 +5039,9 @@ class DeviceBayTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
|
|
|
|
|
|
class InventoryItemTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
class InventoryItemTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
|
model = InventoryItem
|
|
model = InventoryItem
|
|
|
|
|
+ bulk_create_permissions = (
|
|
|
|
|
+ 'dcim.view_device', 'dcim.view_inventoryitemrole', 'dcim.view_manufacturer', 'extras.view_tag',
|
|
|
|
|
+ )
|
|
|
validation_excluded_fields = ('name', 'label')
|
|
validation_excluded_fields = ('name', 'label')
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
@@ -6040,6 +6155,7 @@ class PowerFeedTestCase(ViewTestCases.PrimaryObjectViewTestCase):
|
|
|
|
|
|
|
|
class CoolingIntakeTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCase):
|
|
class CoolingIntakeTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCase):
|
|
|
model = CoolingIntakeTemplate
|
|
model = CoolingIntakeTemplate
|
|
|
|
|
+ bulk_create_permissions = ('dcim.view_devicetype',)
|
|
|
validation_excluded_fields = ('name', 'label')
|
|
validation_excluded_fields = ('name', 'label')
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
@@ -6084,6 +6200,7 @@ class CoolingIntakeTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTes
|
|
|
|
|
|
|
|
class CoolingOutflowTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCase):
|
|
class CoolingOutflowTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTestCase):
|
|
|
model = CoolingOutflowTemplate
|
|
model = CoolingOutflowTemplate
|
|
|
|
|
+ bulk_create_permissions = ('dcim.view_coolingintaketemplate', 'dcim.view_devicetype')
|
|
|
validation_excluded_fields = ('name', 'label')
|
|
validation_excluded_fields = ('name', 'label')
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
@@ -6129,6 +6246,7 @@ class CoolingOutflowTemplateTestCase(ViewTestCases.DeviceComponentTemplateViewTe
|
|
|
|
|
|
|
|
class CoolingIntakeTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
class CoolingIntakeTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
|
model = CoolingIntake
|
|
model = CoolingIntake
|
|
|
|
|
+ bulk_create_permissions = ('dcim.view_device', 'extras.view_tag')
|
|
|
validation_excluded_fields = ('name', 'label')
|
|
validation_excluded_fields = ('name', 'label')
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
@@ -6194,6 +6312,7 @@ class CoolingIntakeTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
|
|
|
|
|
|
class CoolingOutflowTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
class CoolingOutflowTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
|
|
model = CoolingOutflow
|
|
model = CoolingOutflow
|
|
|
|
|
+ bulk_create_permissions = ('dcim.view_coolingintake', 'dcim.view_device', 'extras.view_tag')
|
|
|
validation_excluded_fields = ('name', 'label')
|
|
validation_excluded_fields = ('name', 'label')
|
|
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|