mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-31 04:46:26 -06:00
7699 fix ipam tests
This commit is contained in:
parent
65295f6d79
commit
9108915604
@ -148,7 +148,7 @@ class VLANQuerySet(RestrictedQuerySet):
|
|||||||
|
|
||||||
# Find all relevant VLANGroups
|
# Find all relevant VLANGroups
|
||||||
q = Q()
|
q = Q()
|
||||||
site = vm.site or vm.cluster.site
|
site = vm.site or vm.cluster._site
|
||||||
if vm.cluster:
|
if vm.cluster:
|
||||||
# Add VLANGroups scoped to the assigned cluster (or its group)
|
# Add VLANGroups scoped to the assigned cluster (or its group)
|
||||||
q |= Q(
|
q |= Q(
|
||||||
|
@ -1674,11 +1674,12 @@ class VLANTestCase(TestCase, ChangeLoggedFilterSetTests):
|
|||||||
|
|
||||||
cluster_type = ClusterType.objects.create(name='Cluster Type 1', slug='cluster-type-1')
|
cluster_type = ClusterType.objects.create(name='Cluster Type 1', slug='cluster-type-1')
|
||||||
clusters = (
|
clusters = (
|
||||||
Cluster(name='Cluster 1', type=cluster_type, group=cluster_groups[0], site=sites[0]),
|
Cluster(name='Cluster 1', type=cluster_type, group=cluster_groups[0], scope=sites[0]),
|
||||||
Cluster(name='Cluster 2', type=cluster_type, group=cluster_groups[1], site=sites[1]),
|
Cluster(name='Cluster 2', type=cluster_type, group=cluster_groups[1], scope=sites[1]),
|
||||||
Cluster(name='Cluster 3', type=cluster_type, group=cluster_groups[2], site=sites[2]),
|
Cluster(name='Cluster 3', type=cluster_type, group=cluster_groups[2], scope=sites[2]),
|
||||||
)
|
)
|
||||||
Cluster.objects.bulk_create(clusters)
|
for cluster in clusters:
|
||||||
|
cluster.save()
|
||||||
|
|
||||||
virtual_machines = (
|
virtual_machines = (
|
||||||
VirtualMachine(name='Virtual Machine 1', cluster=clusters[0]),
|
VirtualMachine(name='Virtual Machine 1', cluster=clusters[0]),
|
||||||
|
Loading…
Reference in New Issue
Block a user