mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Misc test fixes
This commit is contained in:
@ -484,7 +484,7 @@ class PowerOutletViewSet(CableTraceMixin, ModelViewSet):
|
|||||||
|
|
||||||
class InterfaceViewSet(CableTraceMixin, ModelViewSet):
|
class InterfaceViewSet(CableTraceMixin, ModelViewSet):
|
||||||
queryset = Interface.objects.prefetch_related(
|
queryset = Interface.objects.prefetch_related(
|
||||||
'device', '_connected_interface', '_connected_circuittermination', 'cable', 'ip_addresses', 'tags'
|
'device', '_connected_interface', '_connected_circuittermination', 'cable', 'ipaddresses', 'tags'
|
||||||
).filter(
|
).filter(
|
||||||
device__isnull=False
|
device__isnull=False
|
||||||
)
|
)
|
||||||
|
@ -1254,8 +1254,8 @@ class DeviceTestCase(TestCase):
|
|||||||
|
|
||||||
# Assign primary IPs for filtering
|
# Assign primary IPs for filtering
|
||||||
ipaddresses = (
|
ipaddresses = (
|
||||||
IPAddress(address='192.0.2.1/24', interface=interfaces[0]),
|
IPAddress(address='192.0.2.1/24', assigned_object=interfaces[0]),
|
||||||
IPAddress(address='192.0.2.2/24', interface=interfaces[1]),
|
IPAddress(address='192.0.2.2/24', assigned_object=interfaces[1]),
|
||||||
)
|
)
|
||||||
IPAddress.objects.bulk_create(ipaddresses)
|
IPAddress.objects.bulk_create(ipaddresses)
|
||||||
Device.objects.filter(pk=devices[0].pk).update(primary_ip4=ipaddresses[0])
|
Device.objects.filter(pk=devices[0].pk).update(primary_ip4=ipaddresses[0])
|
||||||
|
Reference in New Issue
Block a user