#NEWLINE# @ patch ( 'pinax.stripe.actions.sources.delete_card' ) #NEWLINE# def test_post_on_error( self , CreateMock ) : #NEWLINE# #INDENT# CreateMock . side_effect = stripe . CardError ( 'Bad card' , 'Param' , 'CODE' ) #NEWLINE# self . client . login ( username = response . user . username , password = self . password ) #NEWLINE# response = self . client . post ( reverse ( 'pinax_stripe_payment_method_delete' , args = [ self . card . pk ] ) , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEquals ( response . status_code , 200 ) #NEWLINE# self . assertTrue ( ( 'errors' in response . context_data ) )