mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-21 04:42:22 -06:00
Add 'display' field to all REST API serializers
This commit is contained in:
@@ -22,7 +22,7 @@ class AppTest(APITestCase):
|
||||
|
||||
class VRFTest(APIViewTestCases.APIViewTestCase):
|
||||
model = VRF
|
||||
brief_fields = ['display_name', 'id', 'name', 'prefix_count', 'rd', 'url']
|
||||
brief_fields = ['display', 'display_name', 'id', 'name', 'prefix_count', 'rd', 'url']
|
||||
create_data = [
|
||||
{
|
||||
'name': 'VRF 4',
|
||||
@@ -54,7 +54,7 @@ class VRFTest(APIViewTestCases.APIViewTestCase):
|
||||
|
||||
class RouteTargetTest(APIViewTestCases.APIViewTestCase):
|
||||
model = RouteTarget
|
||||
brief_fields = ['id', 'name', 'url']
|
||||
brief_fields = ['display', 'id', 'name', 'url']
|
||||
create_data = [
|
||||
{
|
||||
'name': '65000:1004',
|
||||
@@ -83,7 +83,7 @@ class RouteTargetTest(APIViewTestCases.APIViewTestCase):
|
||||
|
||||
class RIRTest(APIViewTestCases.APIViewTestCase):
|
||||
model = RIR
|
||||
brief_fields = ['aggregate_count', 'id', 'name', 'slug', 'url']
|
||||
brief_fields = ['aggregate_count', 'display', 'id', 'name', 'slug', 'url']
|
||||
create_data = [
|
||||
{
|
||||
'name': 'RIR 4',
|
||||
@@ -115,7 +115,7 @@ class RIRTest(APIViewTestCases.APIViewTestCase):
|
||||
|
||||
class AggregateTest(APIViewTestCases.APIViewTestCase):
|
||||
model = Aggregate
|
||||
brief_fields = ['family', 'id', 'prefix', 'url']
|
||||
brief_fields = ['display', 'family', 'id', 'prefix', 'url']
|
||||
bulk_update_data = {
|
||||
'description': 'New description',
|
||||
}
|
||||
@@ -154,7 +154,7 @@ class AggregateTest(APIViewTestCases.APIViewTestCase):
|
||||
|
||||
class RoleTest(APIViewTestCases.APIViewTestCase):
|
||||
model = Role
|
||||
brief_fields = ['id', 'name', 'prefix_count', 'slug', 'url', 'vlan_count']
|
||||
brief_fields = ['display', 'id', 'name', 'prefix_count', 'slug', 'url', 'vlan_count']
|
||||
create_data = [
|
||||
{
|
||||
'name': 'Role 4',
|
||||
@@ -186,7 +186,7 @@ class RoleTest(APIViewTestCases.APIViewTestCase):
|
||||
|
||||
class PrefixTest(APIViewTestCases.APIViewTestCase):
|
||||
model = Prefix
|
||||
brief_fields = ['family', 'id', 'prefix', 'url']
|
||||
brief_fields = ['display', 'family', 'id', 'prefix', 'url']
|
||||
create_data = [
|
||||
{
|
||||
'prefix': '192.168.4.0/24',
|
||||
@@ -360,7 +360,7 @@ class PrefixTest(APIViewTestCases.APIViewTestCase):
|
||||
|
||||
class IPAddressTest(APIViewTestCases.APIViewTestCase):
|
||||
model = IPAddress
|
||||
brief_fields = ['address', 'family', 'id', 'url']
|
||||
brief_fields = ['address', 'display', 'family', 'id', 'url']
|
||||
create_data = [
|
||||
{
|
||||
'address': '192.168.0.4/24',
|
||||
@@ -389,7 +389,7 @@ class IPAddressTest(APIViewTestCases.APIViewTestCase):
|
||||
|
||||
class VLANGroupTest(APIViewTestCases.APIViewTestCase):
|
||||
model = VLANGroup
|
||||
brief_fields = ['id', 'name', 'slug', 'url', 'vlan_count']
|
||||
brief_fields = ['display', 'id', 'name', 'slug', 'url', 'vlan_count']
|
||||
create_data = [
|
||||
{
|
||||
'name': 'VLAN Group 4',
|
||||
@@ -421,7 +421,7 @@ class VLANGroupTest(APIViewTestCases.APIViewTestCase):
|
||||
|
||||
class VLANTest(APIViewTestCases.APIViewTestCase):
|
||||
model = VLAN
|
||||
brief_fields = ['display_name', 'id', 'name', 'url', 'vid']
|
||||
brief_fields = ['display', 'display_name', 'id', 'name', 'url', 'vid']
|
||||
bulk_update_data = {
|
||||
'description': 'New description',
|
||||
}
|
||||
@@ -481,7 +481,7 @@ class VLANTest(APIViewTestCases.APIViewTestCase):
|
||||
|
||||
class ServiceTest(APIViewTestCases.APIViewTestCase):
|
||||
model = Service
|
||||
brief_fields = ['id', 'name', 'ports', 'protocol', 'url']
|
||||
brief_fields = ['display', 'id', 'name', 'ports', 'protocol', 'url']
|
||||
bulk_update_data = {
|
||||
'description': 'New description',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user