#NEWLINE# @ patch ( 'djstripe.models.Charge.send_receipt' ) #NEWLINE# @ patch ( 'djstripe.models.Customer.record_charge' , return_value = Charge ( ) ) #NEWLINE# def test_sync_from_stripe_data_with_charge_no_receipt( self , record_charge_mock , send_receipt_mock ) : #NEWLINE# #INDENT# record_charge_mock . return_value = Charge ( customer = self . customer ) #NEWLINE# FAKE_INVOICE_WITH_CHARGE = deepcopy ( FAKE_INVOICE ) #NEWLINE# FAKE_INVOICE_WITH_CHARGE [ 'id' ] = 'in_zzzzzzzzzzzzzzz1' #NEWLINE# FAKE_INVOICE_WITH_CHARGE [ 'subscription' ] = 'sub_zzzzzzzzzzzzzzz1' #NEWLINE# FAKE_INVOICE_WITH_CHARGE [ 'lines' ] [ 'data' ] [ 0 ] [ 'id' ] = 'sub_zzzzzzzzzzzzzzz1' #NEWLINE# FAKE_INVOICE_WITH_CHARGE [ 'charge' ] = 'taco1' #NEWLINE# Invoice . sync_from_stripe_data ( FAKE_INVOICE_WITH_CHARGE , send_receipt = False ) #NEWLINE# record_charge_mock . assert_called_once_with ( 'taco1' ) #NEWLINE# self . assertFalse ( send_receipt_mock . called )