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

Add 'display' field to all REST API serializers

This commit is contained in:
Jeremy Stretch
2021-03-16 10:06:25 -04:00
parent ee7f7c877a
commit fb48c1f6dd
26 changed files with 287 additions and 256 deletions

View File

@@ -19,7 +19,7 @@ class AppTest(APITestCase):
class ClusterTypeTest(APIViewTestCases.APIViewTestCase):
model = ClusterType
brief_fields = ['cluster_count', 'id', 'name', 'slug', 'url']
brief_fields = ['cluster_count', 'display', 'id', 'name', 'slug', 'url']
create_data = [
{
'name': 'Cluster Type 4',
@@ -51,7 +51,7 @@ class ClusterTypeTest(APIViewTestCases.APIViewTestCase):
class ClusterGroupTest(APIViewTestCases.APIViewTestCase):
model = ClusterGroup
brief_fields = ['cluster_count', 'id', 'name', 'slug', 'url']
brief_fields = ['cluster_count', 'display', 'id', 'name', 'slug', 'url']
create_data = [
{
'name': 'Cluster Group 4',
@@ -83,7 +83,7 @@ class ClusterGroupTest(APIViewTestCases.APIViewTestCase):
class ClusterTest(APIViewTestCases.APIViewTestCase):
model = Cluster
brief_fields = ['id', 'name', 'url', 'virtualmachine_count']
brief_fields = ['display', 'id', 'name', 'url', 'virtualmachine_count']
bulk_update_data = {
'comments': 'New comment',
}
@@ -131,7 +131,7 @@ class ClusterTest(APIViewTestCases.APIViewTestCase):
class VirtualMachineTest(APIViewTestCases.APIViewTestCase):
model = VirtualMachine
brief_fields = ['id', 'name', 'url']
brief_fields = ['display', 'id', 'name', 'url']
bulk_update_data = {
'status': 'staged',
}
@@ -207,7 +207,7 @@ class VirtualMachineTest(APIViewTestCases.APIViewTestCase):
class VMInterfaceTest(APIViewTestCases.APIViewTestCase):
model = VMInterface
brief_fields = ['id', 'name', 'url', 'virtual_machine']
brief_fields = ['display', 'id', 'name', 'url', 'virtual_machine']
bulk_update_data = {
'description': 'New description',
}