#NEWLINE# def test_topic_detail_viewed( self ) : #NEWLINE# #INDENT# '\n        Calls utils.topic_viewed\n        ' #NEWLINE# def mocked_topic_viewed( request , topic ) : #NEWLINE# #INDENT# self . _user = request . user #NEWLINE# self . _topic = topic #NEWLINE# #UNINDENT# ( org_viewed , utils_topic . topic_viewed ) = ( utils_topic . topic_viewed , mocked_topic_viewed ) #NEWLINE# try : #NEWLINE# #INDENT# utils . login ( self ) #NEWLINE# category = utils . create_category ( ) #NEWLINE# topic = utils . create_topic ( category = category , user = self . user ) #NEWLINE# response = self . client . get ( reverse ( 'spirit:topic:detail' , kwargs = { #NEWLINE# #INDENT# 'pk' : topic . pk , #NEWLINE# 'slug' : topic . slug , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# self . assertEqual ( response . status_code , 200 ) #NEWLINE# self . assertEqual ( self . _topic , topic ) #NEWLINE# self . assertEqual ( self . _user , self . user ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# utils_topic . topic_viewed = org_viewed