33
44import pytest
55
6- from . .views import EntryViewSet
6+ from example .views import EntryViewSet
77from rest_framework_json_api .pagination import PageNumberPagination
88
99from example .tests .utils import dump_json , redump_json
1010
1111pytestmark = pytest .mark .django_db
1212
1313
14- def test_multiple_entries_no_pagination (rf , multiple_entries ):
14+ # rf == request_factory
15+ def test_multiple_entries_no_pagination (multiple_entries , rf ):
1516
1617 expected = {
1718 "data" : [
@@ -20,8 +21,8 @@ def test_multiple_entries_no_pagination(rf, multiple_entries):
2021 "id" : "1" ,
2122 "attributes" :
2223 {
23- "headline" : "The Absolute Minimum Every Software DeveloperAbsolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)" ,
24- "bodyText" : "Here goes the body text" ,
24+ "headline" : multiple_entries [ 0 ]. headline ,
25+ "bodyText" : multiple_entries [ 0 ]. body_text ,
2526 "pubDate" : None ,
2627 "modDate" : None
2728 },
@@ -33,6 +34,10 @@ def test_multiple_entries_no_pagination(rf, multiple_entries):
3334 "authors" : {
3435 "meta" : {"count" : 1 },
3536 "data" : [{"type" : "authors" , "id" : "1" }]
37+ },
38+ "comments" : {
39+ "meta" : {"count" : 1 },
40+ "data" : [{"type" : "comments" , "id" : "1" }]
3641 }
3742 }
3843 },
@@ -41,8 +46,8 @@ def test_multiple_entries_no_pagination(rf, multiple_entries):
4146 "id" : "2" ,
4247 "attributes" :
4348 {
44- "headline" : "Pragmatic Unicode" ,
45- "bodyText" : "Here goes the body text" ,
49+ "headline" : multiple_entries [ 1 ]. headline ,
50+ "bodyText" : multiple_entries [ 1 ]. body_text ,
4651 "pubDate" : None ,
4752 "modDate" : None
4853 },
@@ -54,6 +59,10 @@ def test_multiple_entries_no_pagination(rf, multiple_entries):
5459 "authors" : {
5560 "meta" : {"count" : 1 },
5661 "data" : [{"type" : "authors" , "id" : "2" }]
62+ },
63+ "comments" : {
64+ "meta" : {"count" : 1 },
65+ "data" : [{"type" : "comments" , "id" : "2" }]
5766 }
5867 }
5968 },
0 commit comments