#NEWLINE# @ pytest . mark . xfail ( reason = "haven't migrated transfer_takes yet" ) #NEWLINE# @ mock . patch . object ( Payday , 'fetch_card_holds' ) #NEWLINE# @ mock . patch ( 'gratipay.billing.payday.create_card_hold' ) #NEWLINE# def test_ncc_failing( self , cch , fch ) : #NEWLINE# #INDENT# self . janet . set_tip_to ( self . homer , 24 ) #NEWLINE# fch . return_value = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# cch . return_value = ( None , 'oops' ) #NEWLINE# payday = Payday . start ( ) #NEWLINE# before = self . fetch_payday ( ) #NEWLINE# assert ( before [ 'ncc_failing' ] == 0 ) #NEWLINE# payday . payin ( ) #NEWLINE# after = self . fetch_payday ( ) #NEWLINE# assert ( after [ 'ncc_failing' ] == 1 )