Просмотр исходного кода

9856 core test sans DjangoModelType

Arthur 1 год назад
Родитель
Сommit
4784829477
2 измененных файлов с 5 добавлено и 1 удалено
  1. 1 1
      netbox/core/graphql/types.py
  2. 4 0
      netbox/utilities/testing/api.py

+ 1 - 1
netbox/core/graphql/types.py

@@ -20,7 +20,7 @@ __all__ = (
     filters=DataFileFilter
 )
 class DataFileType(BaseObjectType):
-    pass
+    source: Annotated["DataSourceType", strawberry.lazy('core.graphql.types')]
 
 
 @strawberry_django.type(

+ 4 - 0
netbox/utilities/testing/api.py

@@ -472,8 +472,10 @@ 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
@@ -482,8 +484,10 @@ class APIViewTestCases:
                     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'