def test_approved_payment_notification(rf, tp_provider):
    payment = Payment()
    payment.attrs.request_key = '1fb7cc9a-14dd-42ec-bf1e-6d5820799642'
    payment.attrs.form_url = ('https://forms.todopago.com.ar/formulario/commands?command=formulario&amp;m=a6104bad3-1be7-4e8e-932e-e927100b2e86&amp;fr=1',)
    payment.save()
    request = rf.get('/payments/process/d16695e8-b76d-4438-bd10-634545ecb1d6/', {'Answer': '44caba31-1373-4544-aa6b-42abff696944'})
    operation_status = OperationStatus(status_code=(- 1), status_message='APROBADA', authorization_key='817824df-8614-4ce8-a6c9-abdf884024ab')
    with patch('python_todopago.TodoPagoConnector.get_operation_status', spec=True, return_value=operation_status), patch('payments.todopago.redirect', spec=True) as redirect:
        rv = tp_provider.process_callback(payment, request)
    assert (rv == redirect(payment.get_success_url()))
def test_approved_payment_notification(rf, tp_provider):
    payment = Payment()
    payment.attrs.request_key = '1fb7cc9a-14dd-42ec-bf1e-6d5820799642'
    payment.attrs.form_url = ('https://forms.todopago.com.ar/formulario/commands?command=formulario&amp;m=a6104bad3-1be7-4e8e-932e-e927100b2e86&amp;fr=1',)
    payment.save()
    request = rf.get('/payments/process/d16695e8-b76d-4438-bd10-634545ecb1d6/', {'Answer': '44caba31-1373-4544-aa6b-42abff696944'})
    operation_status = OperationStatus(status_code=(- 1), status_message='APROBADA', authorization_key='817824df-8614-4ce8-a6c9-abdf884024ab')
    with patch('python_todopago.TodoPagoConnector.get_operation_status', spec=True, return_value=operation_status), patch('payments.todopago.redirect', spec=True) as redirect:
        rv = tp_provider.process_callback(payment, request)
    assert (rv == redirect(payment.get_success_url()))