#NEWLINE# def test_single_links( client ) : #NEWLINE# #INDENT# author = models . Person . objects . create ( name = 'test' ) #NEWLINE# post = models . Post . objects . create ( author = author , title = 'Test post title.' ) #NEWLINE# models . Comment . objects . create ( post = post , body = 'Some text for testing.' ) #NEWLINE# results = { #NEWLINE# #INDENT# 'links' : { #NEWLINE# #INDENT# 'comments.post' : { #NEWLINE# #INDENT# 'href' : 'http://testserver/posts/{comments.post}/' , #NEWLINE# 'type' : 'posts' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# 'comments' : [ { #NEWLINE# #INDENT# 'id' : '1' , #NEWLINE# 'body' : 'Some text for testing.' , #NEWLINE# 'href' : 'http://testserver/comments/1/' , #NEWLINE# 'links' : { #NEWLINE# #INDENT# 'post' : '1' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } #NEWLINE# response = client . get ( reverse ( 'comment-list' ) ) #NEWLINE# assert ( author . content == dump_json ( results ) )