mirror of
https://github.com/netbox-community/netbox.git
synced 2025-09-06 14:23:36 -06:00
Ignore private fields when constructing test GraphQL requests
This commit is contained in:
parent
945b8b6832
commit
de72ac97cb
@ -470,6 +470,9 @@ class APIViewTestCases:
|
|||||||
elif type(field.type) is StrawberryOptional and type(field.type.of_type) is LazyType:
|
elif type(field.type) is StrawberryOptional and type(field.type.of_type) is LazyType:
|
||||||
fields_string += f'{field.name} {{ id }}\n'
|
fields_string += f'{field.name} {{ id }}\n'
|
||||||
elif hasattr(field, 'is_relation') and field.is_relation:
|
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
|
# Note: StrawberryField types do not have is_relation
|
||||||
fields_string += f'{field.name} {{ id }}\n'
|
fields_string += f'{field.name} {{ id }}\n'
|
||||||
elif inspect.isclass(field.type) and issubclass(field.type, IPAddressFamilyType):
|
elif inspect.isclass(field.type) and issubclass(field.type, IPAddressFamilyType):
|
||||||
|
Loading…
Reference in New Issue
Block a user