mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-13 19:18:16 -06:00
add missing site
This commit is contained in:
parent
ea3550ff07
commit
da037d6dda
@ -1,7 +1,7 @@
|
|||||||
from django.test import TransactionTestCase
|
from django.test import TransactionTestCase
|
||||||
|
|
||||||
from circuits.models import Provider, Circuit, CircuitType
|
from circuits.models import Provider, Circuit, CircuitType
|
||||||
from dcim.models import Location
|
from dcim.models import Location, Site
|
||||||
from extras.choices import ChangeActionChoices
|
from extras.choices import ChangeActionChoices
|
||||||
from extras.models import Branch, StagedChange, Tag
|
from extras.models import Branch, StagedChange, Tag
|
||||||
from ipam.models import ASN, RIR
|
from ipam.models import ASN, RIR
|
||||||
@ -14,6 +14,8 @@ class StagingTestCase(TransactionTestCase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
create_tags('Alpha', 'Bravo', 'Charlie')
|
create_tags('Alpha', 'Bravo', 'Charlie')
|
||||||
|
|
||||||
|
Site.objects.create(name="Site 1", slug="site-1")
|
||||||
|
|
||||||
rir = RIR.objects.create(name='RIR 1', slug='rir-1')
|
rir = RIR.objects.create(name='RIR 1', slug='rir-1')
|
||||||
asns = (
|
asns = (
|
||||||
ASN(asn=65001, rir=rir),
|
ASN(asn=65001, rir=rir),
|
||||||
@ -47,6 +49,7 @@ class StagingTestCase(TransactionTestCase):
|
|||||||
branch = Branch.objects.create(name='Branch 1')
|
branch = Branch.objects.create(name='Branch 1')
|
||||||
tags = Tag.objects.all()
|
tags = Tag.objects.all()
|
||||||
asns = ASN.objects.all()
|
asns = ASN.objects.all()
|
||||||
|
site = Site.objects.first()
|
||||||
|
|
||||||
with checkout(branch):
|
with checkout(branch):
|
||||||
provider = Provider.objects.create(name='Provider D', slug='provider-d')
|
provider = Provider.objects.create(name='Provider D', slug='provider-d')
|
||||||
@ -55,7 +58,7 @@ class StagingTestCase(TransactionTestCase):
|
|||||||
circuit.tags.set(tags)
|
circuit.tags.set(tags)
|
||||||
|
|
||||||
# Test MPTT Model
|
# Test MPTT Model
|
||||||
location = Location.objects.create(name='Location 1', slug='location-1')
|
location = Location.objects.create(name='Location 1', slug='location-1', site=site)
|
||||||
|
|
||||||
# Sanity-checking
|
# Sanity-checking
|
||||||
self.assertEqual(Provider.objects.count(), 4)
|
self.assertEqual(Provider.objects.count(), 4)
|
||||||
|
Loading…
Reference in New Issue
Block a user