#NEWLINE# def test_reply_without_post_permission( self ) : #NEWLINE# #INDENT# 'Posting without post_in_forum permission should 403.' #NEWLINE# rforum = RestrictedForumFactory ( permission_code = 'forums_forum.post_in_forum' ) #NEWLINE# t = ThreadFactory ( forum = rforum ) #NEWLINE# u = UserFactory ( ) #NEWLINE# self . client . login ( username = u . username , password = 'testpass' ) #NEWLINE# with patch . object ( Forum , 'allows_viewing_by' , Mock ( return_value = True ) ) : #NEWLINE# #INDENT# response = post ( response . client , 'forums.reply' , { #NEWLINE# #INDENT# 'content' : 'Blahs' , #NEWLINE# #UNINDENT# } , args = [ t . forum . slug , t . id ] ) #NEWLINE# #UNINDENT# eq_ ( 403 , response . status_code )