From 005a33974526641c7e719bccbb8c6d235b54dc63 Mon Sep 17 00:00:00 2001 From: Arthur Date: Thu, 7 Mar 2024 07:39:15 -0800 Subject: [PATCH] 9856 temp checkin --- netbox/dcim/graphql/types.py | 1 + netbox/utilities/testing/api.py | 8 ++------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/netbox/dcim/graphql/types.py b/netbox/dcim/graphql/types.py index 7c10d3747..43c7da413 100644 --- a/netbox/dcim/graphql/types.py +++ b/netbox/dcim/graphql/types.py @@ -129,6 +129,7 @@ class CableTerminationType(NetBoxObjectType): ) class CableType(NetBoxObjectType): color: str + tenant: Annotated["TenantType", strawberry.lazy('tenancy.graphql.types')] | None @strawberry_django.field def terminations(self) -> List[CableTerminationType]: diff --git a/netbox/utilities/testing/api.py b/netbox/utilities/testing/api.py index 59ebc812e..7445a0edd 100644 --- a/netbox/utilities/testing/api.py +++ b/netbox/utilities/testing/api.py @@ -472,25 +472,21 @@ class APIViewTestCases: # this would require a fragment query continue elif field.type is strawberry_django.fields.types.DjangoModelType: - print("") - print("") print("DjangoModelType") print("--------------------------") print(f"{self.model} -> {field.name}") print("") # Dynamic fields must specify a subselection - fields_string += f'{field.name} {{ id }}\n' + fields_string += f'{field.name} {{ pk }}\n' elif type(field.type) is StrawberryOptional: if type(field.type.of_type) is LazyType: fields_string += f'{field.name} {{ id }}\n' elif field.type.of_type == strawberry_django.fields.types.DjangoModelType: - print("") - print("") print("DjangoModelType") print("--------------------------") print(f"{self.model} -> {field.name}") print("") - fields_string += f'{field.name} {{ id }}\n' + fields_string += f'{field.name} {{ pk }}\n' elif hasattr(field, 'is_relation') and field.is_relation: # Note: StrawberryField types do not have is_relation fields_string += f'{field.name} {{ id }}\n'