def test_credit_editor_cancel(self): method = PaymentMethod.get_by_name(self.store, u'credit') client = self.create_client() group = self.create_payment_group(payer=client.person) payment = self.create_payment(method=method, payment_type=Payment.TYPE_OUT, value=6, group=group) payment.set_pending() payment.pay() editor = CreditEditor(self.store, client) editor.description.set_text('Desc') editor.value.set_text('-4') # Canceling the dialog here does not roll back the transaction because # this is done in the caller. editor.cancel() self.assertEquals(client.credit_account_balance, currency(6))
def test_credit_editor_cancel(self): method = PaymentMethod.get_by_name(self.store, u'credit') client = self.create_client() group = self.create_payment_group(payer=client.person) payment = self.create_payment(method=method, payment_type=Payment.TYPE_OUT, value=6, group=group) payment.set_pending() payment.pay() editor = CreditEditor(self.store, client) editor.description.set_text('Desc') editor.value.set_text('-4') # Canceling the dialog here does not roll back the transaction because # this is done in the caller. editor.cancel() self.assertEqual(client.credit_account_balance, currency(6))