mirror of
https://github.com/netbox-community/netbox.git
synced 2026-03-23 18:01:37 +01:00
Introduce the Cloud model
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from django.urls import reverse
|
||||
|
||||
from circuits.choices import *
|
||||
from circuits.models import Circuit, CircuitTermination, CircuitType, Provider
|
||||
from circuits.models import *
|
||||
from dcim.models import Site
|
||||
from utilities.testing import APITestCase, APIViewTestCases
|
||||
|
||||
@@ -178,3 +178,43 @@ class CircuitTerminationTest(APIViewTestCases.APIViewTestCase):
|
||||
cls.bulk_update_data = {
|
||||
'port_speed': 123456
|
||||
}
|
||||
|
||||
|
||||
class CloudTest(APIViewTestCases.APIViewTestCase):
|
||||
model = Cloud
|
||||
brief_fields = ['display', 'id', 'name', 'url']
|
||||
|
||||
@classmethod
|
||||
def setUpTestData(cls):
|
||||
providers = (
|
||||
Provider(name='Provider 1', slug='provider-1'),
|
||||
Provider(name='Provider 2', slug='provider-2'),
|
||||
)
|
||||
Provider.objects.bulk_create(providers)
|
||||
|
||||
clouds = (
|
||||
Cloud(name='Cloud 1', provider=providers[0]),
|
||||
Cloud(name='Cloud 2', provider=providers[0]),
|
||||
Cloud(name='Cloud 3', provider=providers[0]),
|
||||
)
|
||||
Cloud.objects.bulk_create(clouds)
|
||||
|
||||
cls.create_data = [
|
||||
{
|
||||
'name': 'Cloud 4',
|
||||
'provider': providers[0].pk,
|
||||
},
|
||||
{
|
||||
'name': 'Cloud 5',
|
||||
'provider': providers[0].pk,
|
||||
},
|
||||
{
|
||||
'name': 'Cloud 6',
|
||||
'provider': providers[0].pk,
|
||||
},
|
||||
]
|
||||
|
||||
cls.bulk_update_data = {
|
||||
'provider': providers[1].pk,
|
||||
'description': 'New description',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user