Skip to content

Commit c09bf91

Browse files
committed
test: Test excluding of get_model_fields
1 parent 98d6eda commit c09bf91

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

graphene_mongo/tests/test_utils.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,19 @@ def test_get_model_fields_no_duplication():
1414
assert len(reporter_fields) == len(reporter_name_set)
1515

1616

17+
def test_get_model_fields_excluding():
18+
reporter_fields = get_model_fields(Reporter, excluding=[
19+
'first_name', 'last_name'])
20+
reporter_name_set = set(reporter_fields)
21+
assert all(field in reporter_name_set for field in [
22+
'id',
23+
'email',
24+
'articles',
25+
'embedded_articles',
26+
'embedded_list_articles',
27+
'awards'
28+
])
29+
1730
def test_get_model_relation_fields():
1831
article_fields = get_model_fields(Article)
1932
assert all(field in set(article_fields) for field in ['editor', 'reporter'])

0 commit comments

Comments
 (0)