#NEWLINE# @ test . create_stubs ( { #NEWLINE# #INDENT# api . sahara : ( 'data_source_list' , 'data_source_delete' ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# def test_delete( self ) : #NEWLINE# #INDENT# data_source = self . data_sources . first ( ) #NEWLINE# api . sahara . data_source_list ( IsA ( http . HttpRequest ) ) . AndReturn ( self . data_sources . list ( ) ) #NEWLINE# api . sahara . data_source_delete ( IsA ( http . HttpRequest ) , data_source . id ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# form_data = { #NEWLINE# #INDENT# 'action' : ( 'data_sources__delete__%s' % data_source . 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 )