1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Add GraphQL for IPAM

This commit is contained in:
jeremystretch
2021-06-25 10:14:35 -04:00
parent 4c209ed74c
commit 3e0bcd58d4
4 changed files with 152 additions and 10 deletions

View File

@ -20,7 +20,7 @@ class AppTest(APITestCase):
self.assertEqual(response.status_code, 200)
class VRFTest(APIViewTestCases.APIViewTestCase):
class VRFTest(APIViewTestCases.GraphQLTestCase, APIViewTestCases.APIViewTestCase):
model = VRF
brief_fields = ['display', 'id', 'name', 'prefix_count', 'rd', 'url']
create_data = [
@ -52,7 +52,7 @@ class VRFTest(APIViewTestCases.APIViewTestCase):
VRF.objects.bulk_create(vrfs)
class RouteTargetTest(APIViewTestCases.APIViewTestCase):
class RouteTargetTest(APIViewTestCases.GraphQLTestCase, APIViewTestCases.APIViewTestCase):
model = RouteTarget
brief_fields = ['display', 'id', 'name', 'url']
create_data = [
@ -81,7 +81,7 @@ class RouteTargetTest(APIViewTestCases.APIViewTestCase):
RouteTarget.objects.bulk_create(route_targets)
class RIRTest(APIViewTestCases.APIViewTestCase):
class RIRTest(APIViewTestCases.GraphQLTestCase, APIViewTestCases.APIViewTestCase):
model = RIR
brief_fields = ['aggregate_count', 'display', 'id', 'name', 'slug', 'url']
create_data = [
@ -113,7 +113,7 @@ class RIRTest(APIViewTestCases.APIViewTestCase):
RIR.objects.bulk_create(rirs)
class AggregateTest(APIViewTestCases.APIViewTestCase):
class AggregateTest(APIViewTestCases.GraphQLTestCase, APIViewTestCases.APIViewTestCase):
model = Aggregate
brief_fields = ['display', 'family', 'id', 'prefix', 'url']
bulk_update_data = {
@ -152,7 +152,7 @@ class AggregateTest(APIViewTestCases.APIViewTestCase):
]
class RoleTest(APIViewTestCases.APIViewTestCase):
class RoleTest(APIViewTestCases.GraphQLTestCase, APIViewTestCases.APIViewTestCase):
model = Role
brief_fields = ['display', 'id', 'name', 'prefix_count', 'slug', 'url', 'vlan_count']
create_data = [
@ -184,7 +184,7 @@ class RoleTest(APIViewTestCases.APIViewTestCase):
Role.objects.bulk_create(roles)
class PrefixTest(APIViewTestCases.APIViewTestCase):
class PrefixTest(APIViewTestCases.GraphQLTestCase, APIViewTestCases.APIViewTestCase):
model = Prefix
brief_fields = ['_depth', 'display', 'family', 'id', 'prefix', 'url']
create_data = [
@ -358,7 +358,7 @@ class PrefixTest(APIViewTestCases.APIViewTestCase):
self.assertEqual(len(response.data), 8)
class IPAddressTest(APIViewTestCases.APIViewTestCase):
class IPAddressTest(APIViewTestCases.GraphQLTestCase, APIViewTestCases.APIViewTestCase):
model = IPAddress
brief_fields = ['address', 'display', 'family', 'id', 'url']
create_data = [
@ -387,7 +387,7 @@ class IPAddressTest(APIViewTestCases.APIViewTestCase):
IPAddress.objects.bulk_create(ip_addresses)
class VLANGroupTest(APIViewTestCases.APIViewTestCase):
class VLANGroupTest(APIViewTestCases.GraphQLTestCase, APIViewTestCases.APIViewTestCase):
model = VLANGroup
brief_fields = ['display', 'id', 'name', 'slug', 'url', 'vlan_count']
create_data = [
@ -419,7 +419,7 @@ class VLANGroupTest(APIViewTestCases.APIViewTestCase):
VLANGroup.objects.bulk_create(vlan_groups)
class VLANTest(APIViewTestCases.APIViewTestCase):
class VLANTest(APIViewTestCases.GraphQLTestCase, APIViewTestCases.APIViewTestCase):
model = VLAN
brief_fields = ['display', 'id', 'name', 'url', 'vid']
bulk_update_data = {
@ -479,7 +479,7 @@ class VLANTest(APIViewTestCases.APIViewTestCase):
self.assertTrue(content['detail'].startswith('Unable to delete object.'))
class ServiceTest(APIViewTestCases.APIViewTestCase):
class ServiceTest(APIViewTestCases.GraphQLTestCase, APIViewTestCases.APIViewTestCase):
model = Service
brief_fields = ['display', 'id', 'name', 'ports', 'protocol', 'url']
bulk_update_data = {