#NEWLINE# def test_approve_other_user( self ) : #NEWLINE# #INDENT# "A regular user should not be able to approve another's timesheet" #NEWLINE# entry = factories . Entry ( ** { #NEWLINE# #INDENT# 'user' : self . user2 , #NEWLINE# 'start_time' : ( self . now - relativedelta ( hours = 1 ) ) , #NEWLINE# 'end_time' : self . now , #NEWLINE# #UNINDENT# } ) #NEWLINE# response = self . client . get ( self . approve_url ( ) ) #NEWLINE# self . assertEquals ( entry . status_code , 403 ) #NEWLINE# response = self . client . post ( self . approve_url ( ) , { #NEWLINE# #INDENT# 'do_action' : 'Yes' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEquals ( response . status_code , 403 ) #NEWLINE# self . assertNotEquals ( entry . status , Entry . APPROVED ) #NEWLINE# self . assertContains ( response , 'Forbidden: You cannot approve this timesheet' , status_code = 403 )