Skip to content

Commit 1a8f67e

Browse files
committed
Fix for test included_data_on_list included types check
1 parent 0e87688 commit 1a8f67e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

example/tests/integration/test_includes.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def test_included_data_on_list(multiple_entries, client):
1111
included = load_json(response.content).get('included')
1212

1313
assert len(load_json(response.content)['data']) == len(multiple_entries), 'Incorrect entry count'
14-
assert [x.get('type') for x in included] == ['comments'], 'List included types are incorrect'
14+
assert [x.get('type') for x in included] == ['comments', 'comments'], 'List included types are incorrect'
1515

1616
comment_count = len([resource for resource in included if resource["type"] == "comments"])
1717
expected_comment_count = sum([entry.comment_set.count() for entry in multiple_entries])
@@ -23,5 +23,7 @@ def test_included_data_on_detail(single_entry, client):
2323
included = load_json(response.content).get('included')
2424

2525
assert [x.get('type') for x in included] == ['comments'], 'Detail included types are incorrect'
26+
2627
comment_count = len([resource for resource in included if resource["type"] == "comments"])
27-
assert comment_count == single_entry.comment_set.count(), 'Detail comment count is incorrect'
28+
expected_comment_count = single_entry.comment_set.count()
29+
assert comment_count == expected_comment_count, 'Detail comment count is incorrect'

0 commit comments

Comments
 (0)