mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-07-04 04:13:11 +03:00
fix: revert PR-1380
This commit is contained in:
parent
34cef2bccd
commit
047810fe9a
|
@ -1073,6 +1073,9 @@ def test_proxy_model_support():
|
||||||
assert result.data == expected
|
assert result.data == expected
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.xfail(
|
||||||
|
reason="Until https://github.com/graphql-python/graphene-django/pull/1380#issuecomment-1646331317 is fixed."
|
||||||
|
)
|
||||||
def test_model_inheritance_support_reverse_relationships():
|
def test_model_inheritance_support_reverse_relationships():
|
||||||
"""
|
"""
|
||||||
This test asserts that we can query reverse relationships for all Reporters and proxied Reporters and multi table Reporters.
|
This test asserts that we can query reverse relationships for all Reporters and proxied Reporters and multi table Reporters.
|
||||||
|
|
|
@ -19,6 +19,9 @@ def test_get_model_fields_no_duplication():
|
||||||
assert len(film_fields) == len(film_name_set)
|
assert len(film_fields) == len(film_name_set)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.xfail(
|
||||||
|
reason="Until https://github.com/graphql-python/graphene-django/pull/1380#issuecomment-1646331317 is fixed."
|
||||||
|
)
|
||||||
def test_get_reverse_fields_includes_proxied_models():
|
def test_get_reverse_fields_includes_proxied_models():
|
||||||
reporter_fields = get_reverse_fields(Reporter, [])
|
reporter_fields = get_reverse_fields(Reporter, [])
|
||||||
cnn_reporter_fields = get_reverse_fields(CNNReporter, [])
|
cnn_reporter_fields = get_reverse_fields(CNNReporter, [])
|
||||||
|
|
|
@ -47,14 +47,7 @@ def _get_model_ancestry(model):
|
||||||
|
|
||||||
|
|
||||||
def get_reverse_fields(model, local_field_names):
|
def get_reverse_fields(model, local_field_names):
|
||||||
"""
|
for name, attr in model.__dict__.items():
|
||||||
Searches through the model's ancestry and gets reverse relationships the models
|
|
||||||
Yields a tuple of (field.name, field)
|
|
||||||
"""
|
|
||||||
model_ancestry = _get_model_ancestry(model)
|
|
||||||
|
|
||||||
for _model in model_ancestry:
|
|
||||||
for name, attr in _model.__dict__.items():
|
|
||||||
# Don't duplicate any local fields
|
# Don't duplicate any local fields
|
||||||
if name in local_field_names:
|
if name in local_field_names:
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue
Block a user