mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-16 04:02:52 -06:00
Fix RestrictedQuerySet evaluation in tests
This commit is contained in:
parent
5732466e56
commit
10e6b6ca66
@ -416,7 +416,7 @@ class VLANTest(APIViewTestCases.APIViewTestCase):
|
||||
"""
|
||||
Attempt and fail to delete a VLAN with a Prefix assigned to it.
|
||||
"""
|
||||
vlan = VLAN.objects.first()
|
||||
vlan = VLAN.objects.unrestricted().first()
|
||||
Prefix.objects.create(prefix=IPNetwork('192.0.2.0/24'), vlan=vlan)
|
||||
|
||||
self.add_permissions('ipam.delete_vlan')
|
||||
|
@ -43,7 +43,7 @@ class TestPrefix(TestCase):
|
||||
Prefix(prefix=netaddr.IPNetwork('192.0.2.0/24')),
|
||||
Prefix(prefix=netaddr.IPNetwork('192.0.2.0/24')),
|
||||
))
|
||||
duplicate_prefix_pks = [p.pk for p in prefixes[0].get_duplicates()]
|
||||
duplicate_prefix_pks = [p.pk for p in prefixes[0].get_duplicates().unrestricted()]
|
||||
|
||||
self.assertSetEqual(set(duplicate_prefix_pks), {prefixes[1].pk, prefixes[2].pk})
|
||||
|
||||
@ -227,7 +227,7 @@ class TestIPAddress(TestCase):
|
||||
IPAddress(address=netaddr.IPNetwork('192.0.2.1/24')),
|
||||
IPAddress(address=netaddr.IPNetwork('192.0.2.1/24')),
|
||||
))
|
||||
duplicate_ip_pks = [p.pk for p in ips[0].get_duplicates()]
|
||||
duplicate_ip_pks = [p.pk for p in ips[0].get_duplicates().unrestricted()]
|
||||
|
||||
self.assertSetEqual(set(duplicate_ip_pks), {ips[1].pk, ips[2].pk})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user