#NEWLINE# def test_delete_keypair( self ) : #NEWLINE# #INDENT# keypair = self . keypairs . first ( ) #NEWLINE# self . mox . StubOutWithMock ( api . network , 'floating_ip_supported' ) #NEWLINE# self . mox . StubOutWithMock ( api . nova , 'keypair_list' ) #NEWLINE# self . mox . StubOutWithMock ( api . nova , 'keypair_delete' ) #NEWLINE# api . network . floating_ip_supported ( IsA ( http . HttpRequest ) ) . AndReturn ( True ) #NEWLINE# api . nova . keypair_list ( IsA ( http . HttpRequest ) ) . AndReturn ( self . keypairs . list ( ) ) #NEWLINE# api . nova . keypair_delete ( IsA ( http . HttpRequest ) , keypair . name ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# formData = { #NEWLINE# #INDENT# 'action' : ( 'keypairs__delete__%s' % keypair . name ) , #NEWLINE# #UNINDENT# } #NEWLINE# res = self . client . post ( INDEX_VIEW_URL , formData ) #NEWLINE# self . assertRedirectsNoFollow ( res , INDEX_VIEW_URL )