@@ -113,20 +113,20 @@ def test_refund_too_high_amount(self):
113
113
114
114
@patch ("payments.dummy.DummyProvider.refund" )
115
115
def test_refund_without_amount (self , mocked_refund_method ):
116
- refund_amount = None
116
+ captured_amount = Decimal ( "200" )
117
117
with patch .object (BasePayment , "save" ) as mocked_save_method :
118
118
mocked_save_method .return_value = None
119
- mocked_refund_method .return_value = refund_amount
119
+ mocked_refund_method .return_value = captured_amount
120
120
121
- captured_amount = Decimal ("200" )
122
- status = PaymentStatus .CONFIRMED
123
121
payment = Payment (
124
- variant = "default" , status = status , captured_amount = captured_amount
122
+ variant = "default" ,
123
+ status = PaymentStatus .CONFIRMED ,
124
+ captured_amount = captured_amount ,
125
125
)
126
- payment .refund (refund_amount )
127
- self .assertEqual (payment .status , status )
128
- self .assertEqual (payment .captured_amount , captured_amount )
129
- self .assertEqual (mocked_refund_method .call_count , 0 )
126
+ payment .refund ()
127
+ self .assertEqual (payment .status , PaymentStatus . REFUNDED )
128
+ self .assertEqual (payment .captured_amount , Decimal ( 0 ) )
129
+ self .assertEqual (mocked_refund_method .call_count , 1 )
130
130
131
131
@patch ("payments.dummy.DummyProvider.refund" )
132
132
def test_refund_partial_success (self , mocked_refund_method ):
0 commit comments