#NEWLINE# @ test . create_stubs ( { #NEWLINE# #INDENT# api . sahara : ( 'job_list' , 'job_delete' ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# def test_delete( self ) : #NEWLINE# #INDENT# job = self . jobs . first ( ) #NEWLINE# api . sahara . job_list ( IsA ( http . HttpRequest ) ) . AndReturn ( self . jobs . list ( ) ) #NEWLINE# api . sahara . job_delete ( IsA ( http . HttpRequest ) , job . id ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# form_data = { #NEWLINE# #INDENT# 'action' : ( 'jobs__delete__%s' % job . id ) , #NEWLINE# #UNINDENT# } #NEWLINE# res = self . client . post ( INDEX_URL , form_data ) #NEWLINE# self . assertNoFormErrors ( res ) #NEWLINE# self . assertRedirectsNoFollow ( res , INDEX_URL ) #NEWLINE# self . assertMessageCount ( success = 1 )