mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-24 08:25:17 -06:00
9478 fix tests
This commit is contained in:
parent
9c55e43978
commit
bd2de21d93
@ -5,7 +5,7 @@ from django.contrib.auth.models import User
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.urls import reverse
|
||||
from django.test import override_settings
|
||||
from graphene.types import Dynamic as GQLDynamic, List as GQLList
|
||||
from graphene.types import Dynamic as GQLDynamic, List as GQLList, Union as GQLUnion
|
||||
from rest_framework import status
|
||||
from rest_framework.test import APIClient
|
||||
|
||||
@ -449,6 +449,8 @@ class APIViewTestCases:
|
||||
if type(field) is GQLDynamic:
|
||||
# Dynamic fields must specify a subselection
|
||||
fields_string += f'{field_name} {{ id }}\n'
|
||||
elif type(field.type) is GQLList and issubclass(field.type.of_type, GQLUnion):
|
||||
continue
|
||||
elif type(field.type) is GQLList and field_name != 'choices':
|
||||
# TODO: Come up with something more elegant
|
||||
# Temporary hack to support automated testing of reverse generic relations
|
||||
|
Loading…
Reference in New Issue
Block a user