def test_should_map_only_few_fields(): class Reporter2(DjangoObjectType): class Meta: model = Reporter only_fields = ('id', 'email') assert_equal_lists(Reporter2._meta.fields_map.keys(), ['id', 'email'])
def test_should_map_only_few_fields(): class Reporter2(SQLAlchemyObjectType): class Meta: model = Reporter only_fields = ("id", "email") assert_equal_lists(Reporter2._meta.fields_map.keys(), ["id", "email"])
def test_object_type(): object_type = schema.T(Human) Human._meta.fields_map assert Human._meta.interface is False assert isinstance(object_type, GraphQLObjectType) assert_equal_lists(object_type.get_fields().keys(), ["headline", "id", "reporter", "pubDate"]) assert schema.T(DjangoNode) in object_type.get_interfaces()
def test_objecttype_registered(): object_type = schema.T(Character) assert isinstance(object_type, GraphQLObjectType) assert Character._meta.model == Reporter assert_equal_lists( object_type.get_fields().keys(), ['articles', 'firstName', 'lastName', 'email', 'id'] )
def test_pseudo_interface_registered(): object_type = schema.T(Character) assert Character._meta.is_interface is True assert isinstance(object_type, GraphQLInterfaceType) assert Character._meta.model == Reporter assert_equal_lists( object_type.get_fields().keys(), ['articles', 'firstName', 'lastName', 'email', 'pets', 'id'])
def test_object_type(): object_type = schema.T(Human) Human._meta.fields_map assert Human._meta.is_interface is False assert isinstance(object_type, GraphQLObjectType) assert_equal_lists(object_type.get_fields().keys(), ['headline', 'id', 'reporter', 'pubDate']) assert schema.T(DjangoNode) in object_type.get_interfaces()
def test_should_map_fields_correctly(): class ReporterType2(DjangoObjectType): class Meta: model = Reporter assert_equal_lists(ReporterType2._meta.fields_map.keys(), [ 'articles', 'first_name', 'last_name', 'email', 'pets', 'id', 'films' ])
def test_should_map_fields_correctly(): class ReporterType2(SQLAlchemyObjectType): class Meta: model = Reporter assert_equal_lists( ReporterType2._meta.fields_map.keys(), ["articles", "first_name", "last_name", "email", "pets", "id"] )
def test_should_map_fields_correctly(): class ReporterType2(DjangoObjectType): class Meta: model = Reporter assert_equal_lists( ReporterType2._meta.fields_map.keys(), ['articles', 'first_name', 'last_name', 'email', 'pets', 'id'] )
def test_pseudo_interface_registered(): object_type = schema.T(Character) assert Character._meta.is_interface is True assert isinstance(object_type, GraphQLInterfaceType) assert Character._meta.model == Reporter assert_equal_lists( object_type.get_fields().keys(), ['articles', 'firstName', 'lastName', 'email', 'pets', 'id'] )
def test_should_map_only_few_fields(): class Reporter2(DjangoObjectType): class Meta: model = Reporter only_fields = ('id', 'email') assert_equal_lists( Reporter2._meta.fields_map.keys(), ['id', 'email'] )
def test_object_type(): object_type = schema.T(Human) Human._meta.fields_map assert Human._meta.interface is False assert isinstance(object_type, GraphQLObjectType) assert_equal_lists( object_type.get_fields().keys(), ['headline', 'id', 'reporter', 'reporterId', 'pubDate'] ) assert schema.T(SQLAlchemyNode) in object_type.get_interfaces()
def test_object_type(): object_type = schema.T(Human) Human._meta.fields_map assert Human._meta.is_interface is False assert isinstance(object_type, GraphQLObjectType) assert_equal_lists( object_type.get_fields().keys(), ['headline', 'id', 'reporter', 'pubDate'] ) # assert object_type.get_fields() == { # 'headline': fields_map['headline'].internal_field(schema), # 'id': fields_map['id'].internal_field(schema), # 'reporter': fields_map['reporter'].internal_field(schema), # 'pubDate': fields_map['pub_date'].internal_field(schema), # } assert schema.T(DjangoNode) in object_type.get_interfaces()
def test_schema_get_type_map(): assert_equal_lists( schema.schema.get_type_map().keys(), [ "__Field", "String", "Pet", "Character", "__InputValue", "__Directive", "__TypeKind", "__Schema", "__Type", "Human", "__EnumValue", "Boolean", ], )
def test_schema_get_type_map(): assert_equal_lists(schema.schema.get_type_map().keys(), [ '__Field', 'String', 'Pet', 'Character', '__InputValue', '__Directive', '__DirectiveLocation', '__TypeKind', '__Schema', '__Type', 'Human', '__EnumValue', 'Boolean' ])
def test_schema_get_type_map(): assert_equal_lists( schema.schema.get_type_map().keys(), ['__Field', 'String', 'Pet', 'Character', '__InputValue', '__Directive', '__TypeKind', '__Schema', '__Type', 'Human', '__EnumValue', 'Boolean'])