@@ -232,7 +232,7 @@ async def test_select_custom_fields_with_includes(
232232 ("fields[user]" , "name" ),
233233 ("fields[post]" , "title" ),
234234 # empty str means ignore all fields
235- ("fields[comment ]" , "" ),
235+ ("fields[post_comment ]" , "" ),
236236 ("include" , "posts,posts.comments" ),
237237 ("sort" , "id" ),
238238 ],
@@ -284,7 +284,14 @@ async def test_select_custom_fields_with_includes(
284284 "attributes" : PostAttributesBaseSchema .from_orm (user_2_post ).dict (include = {"title" }),
285285 "id" : str (user_2_post .id ),
286286 "relationships" : {
287- "comments" : {"data" : [{"id" : str (user_1_comment .id ), "type" : "post_comment" }]},
287+ "comments" : {
288+ "data" : [
289+ {
290+ "id" : str (user_1_comment .id ),
291+ "type" : "post_comment" ,
292+ },
293+ ],
294+ },
288295 },
289296 "type" : "post" ,
290297 },
@@ -298,12 +305,12 @@ async def test_select_custom_fields_with_includes(
298305 },
299306 {
300307 "attributes" : {},
301- "id" : "1" ,
308+ "id" : str ( user_1_comment . id ) ,
302309 "type" : "post_comment" ,
303310 },
304311 {
305312 "attributes" : {},
306- "id" : "2" ,
313+ "id" : str ( user_2_comment . id ) ,
307314 "type" : "post_comment" ,
308315 },
309316 ],
@@ -426,7 +433,7 @@ async def test_create_comments_for_post(
426433 user_2 : User ,
427434 user_1_post : Post ,
428435 ):
429- url = app .url_path_for ("get_comment_list " )
436+ url = app .url_path_for ("get_post_comment_list " )
430437 url = f"{ url } ?include=author,post,post.user"
431438 comment_attributes = PostCommentAttributesBaseSchema (
432439 text = fake .sentence (),
@@ -457,7 +464,7 @@ async def test_create_comments_for_post(
457464 comment_id = comment_data .pop ("id" )
458465 assert comment_id
459466 assert comment_data == {
460- "type" : "comment " ,
467+ "type" : "post_comment " ,
461468 "attributes" : comment_attributes ,
462469 "relationships" : {
463470 "post" : {
@@ -515,7 +522,7 @@ async def test_create_comment_error_no_relationship(
515522 :param user_1_post:
516523 :return:
517524 """
518- url = app .url_path_for ("get_comment_list " )
525+ url = app .url_path_for ("get_post_comment_list " )
519526 comment_attributes = PostCommentAttributesBaseSchema (
520527 text = fake .sentence (),
521528 ).dict ()
@@ -556,7 +563,7 @@ async def test_create_comment_error_no_relationships_content(
556563 app : FastAPI ,
557564 client : AsyncClient ,
558565 ):
559- url = app .url_path_for ("get_comment_list " )
566+ url = app .url_path_for ("get_post_comment_list " )
560567 comment_attributes = PostCommentAttributesBaseSchema (
561568 text = fake .sentence (),
562569 ).dict ()
@@ -602,7 +609,7 @@ async def test_create_comment_error_no_relationships_field(
602609 app : FastAPI ,
603610 client : AsyncClient ,
604611 ):
605- url = app .url_path_for ("get_comment_list " )
612+ url = app .url_path_for ("get_post_comment_list " )
606613 comment_attributes = PostCommentAttributesBaseSchema (
607614 text = fake .sentence (),
608615 ).dict ()
0 commit comments