From 1052ea5dd4260c1b6c918f15ffae39e49c0778c6 Mon Sep 17 00:00:00 2001 From: Arthur Date: Wed, 6 Mar 2024 14:00:53 -0800 Subject: [PATCH] 9856 test fix vpn --- netbox/utilities/testing/api.py | 5 ++++- netbox/vpn/graphql/types.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/netbox/utilities/testing/api.py b/netbox/utilities/testing/api.py index 13564ad19..d07b54a36 100644 --- a/netbox/utilities/testing/api.py +++ b/netbox/utilities/testing/api.py @@ -454,7 +454,7 @@ class APIViewTestCases: """ print(f"field_name: {field.name} type: {field.type}") - if field.name == 'front_image': + if field.name == 'assigned_object': breakpoint() pass """ @@ -467,6 +467,9 @@ class APIViewTestCases: elif type(field.type) is StrawberryList and type(field.type.of_type) is StrawberryUnion: # this would require a fragment query continue + elif type(field.type) is StrawberryUnion: + # this would require a fragment query + continue elif field.type is strawberry_django.fields.types.DjangoModelType: # Dynamic fields must specify a subselection fields_string += f'{field.name} {{ pk }}\n' diff --git a/netbox/vpn/graphql/types.py b/netbox/vpn/graphql/types.py index fbd9683e7..93024d126 100644 --- a/netbox/vpn/graphql/types.py +++ b/netbox/vpn/graphql/types.py @@ -103,11 +103,11 @@ class IPSecProposalType(OrganizationalObjectType): class IPSecPolicyType(OrganizationalObjectType): @strawberry_django.field - def proposals(self) -> List[Annotated["IKEProposalType", strawberry.lazy('vpn.graphql.types')]]: + def proposals(self) -> List[Annotated["IPSecProposalType", strawberry.lazy('vpn.graphql.types')]]: return self.proposals.all() @strawberry_django.field - def ipsec_profiles(self) -> List[Annotated["IPSecProposalType", strawberry.lazy('vpn.graphql.types')]]: + def ipsec_profiles(self) -> List[Annotated["IPSecProfileType", strawberry.lazy('vpn.graphql.types')]]: return self.ipsec_profiles.all()