mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-20 12:22:23 -06:00
Closes #6014: Move virtual machine interfaces list to a separate view
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
from django.test import override_settings
|
||||
from django.urls import reverse
|
||||
from netaddr import EUI
|
||||
|
||||
from dcim.choices import InterfaceModeChoices
|
||||
@@ -196,6 +198,19 @@ class VirtualMachineTestCase(ViewTestCases.PrimaryObjectViewTestCase):
|
||||
'comments': 'New comments',
|
||||
}
|
||||
|
||||
@override_settings(EXEMPT_VIEW_PERMISSIONS=['*'])
|
||||
def test_device_interfaces(self):
|
||||
virtualmachine = VirtualMachine.objects.first()
|
||||
vminterfaces = (
|
||||
VMInterface(virtual_machine=virtualmachine, name='Interface 1'),
|
||||
VMInterface(virtual_machine=virtualmachine, name='Interface 2'),
|
||||
VMInterface(virtual_machine=virtualmachine, name='Interface 3'),
|
||||
)
|
||||
VMInterface.objects.bulk_create(vminterfaces)
|
||||
|
||||
url = reverse('virtualization:virtualmachine_interfaces', kwargs={'pk': virtualmachine.pk})
|
||||
self.assertHttpStatus(self.client.get(url), 200)
|
||||
|
||||
|
||||
class VMInterfaceTestCase(ViewTestCases.DeviceComponentViewTestCase):
|
||||
model = VMInterface
|
||||
|
||||
Reference in New Issue
Block a user