diff --git a/netbox/utilities/testing/api.py b/netbox/utilities/testing/api.py index 12e38a27f..9de3c43f8 100644 --- a/netbox/utilities/testing/api.py +++ b/netbox/utilities/testing/api.py @@ -470,6 +470,9 @@ class APIViewTestCases: elif type(field.type) is StrawberryOptional and type(field.type.of_type) is LazyType: fields_string += f'{field.name} {{ id }}\n' elif hasattr(field, 'is_relation') and field.is_relation: + # Ignore private fields + if field.name.startswith('_'): + continue # Note: StrawberryField types do not have is_relation fields_string += f'{field.name} {{ id }}\n' elif inspect.isclass(field.type) and issubclass(field.type, IPAddressFamilyType):