mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Closes #15292: Remove obsolete device_role attribute from Device model
This commit is contained in:
@@ -2156,7 +2156,7 @@ class CablePathTestCase(TestCase):
|
||||
device = Device.objects.create(
|
||||
site=self.site,
|
||||
device_type=self.device.device_type,
|
||||
device_role=self.device.device_role,
|
||||
role=self.device.role,
|
||||
name='Test mid-span Device'
|
||||
)
|
||||
interface1 = Interface.objects.create(device=self.device, name='Interface 1')
|
||||
|
||||
@@ -533,30 +533,6 @@ class DeviceTestCase(TestCase):
|
||||
device2.full_clean()
|
||||
device2.save()
|
||||
|
||||
def test_old_device_role_field(self):
|
||||
"""
|
||||
Ensure that the old device role field sets the value in the new role field.
|
||||
"""
|
||||
|
||||
# Test getter method
|
||||
device = Device(
|
||||
site=Site.objects.first(),
|
||||
device_type=DeviceType.objects.first(),
|
||||
role=DeviceRole.objects.first(),
|
||||
name='Test Device 1',
|
||||
device_role=DeviceRole.objects.first()
|
||||
)
|
||||
device.full_clean()
|
||||
device.save()
|
||||
|
||||
self.assertEqual(device.role, device.device_role)
|
||||
|
||||
# Test setter method
|
||||
device.device_role = DeviceRole.objects.last()
|
||||
device.full_clean()
|
||||
device.save()
|
||||
self.assertEqual(device.role, device.device_role)
|
||||
|
||||
|
||||
class CableTestCase(TestCase):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user