|
|
|
@ -145,7 +145,7 @@ def fake_post_success(view, request): |
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.django_db |
|
|
|
@pytest.mark.django_db |
|
|
|
@mock.patch('django.core.mail.EmailMessage.send') |
|
|
|
@mock.patch('django.core.mail.EmailMessage.send') |
|
|
|
@mock.patch('finance.views.YandexAvisoView.post', fake_post_success) |
|
|
|
@mock.patch('finance.views.YandexCheckView.post', fake_post_success) |
|
|
|
def test_confirm_pay_auto_success(mocked_email, api_client, bill_yandex, student): |
|
|
|
def test_confirm_pay_auto_success(mocked_email, api_client, bill_yandex, student): |
|
|
|
assert Progress.objects.count() is 0 |
|
|
|
assert Progress.objects.count() is 0 |
|
|
|
assert ProgressLesson.objects.count() is 0 |
|
|
|
assert ProgressLesson.objects.count() is 0 |
|
|
|
@ -156,7 +156,7 @@ def test_confirm_pay_auto_success(mocked_email, api_client, bill_yandex, student |
|
|
|
'shopSumAmount': str(payment.shop_amount) |
|
|
|
'shopSumAmount': str(payment.shop_amount) |
|
|
|
} |
|
|
|
} |
|
|
|
api_client.post( |
|
|
|
api_client.post( |
|
|
|
reverse('yandex_money_notice'), |
|
|
|
reverse('yandex_money_check'), |
|
|
|
data=data, |
|
|
|
data=data, |
|
|
|
status=status.HTTP_200_OK |
|
|
|
status=status.HTTP_200_OK |
|
|
|
) |
|
|
|
) |
|
|
|
@ -177,7 +177,7 @@ def fake_post_fail(view, request): |
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.django_db |
|
|
|
@pytest.mark.django_db |
|
|
|
@mock.patch('django.core.mail.EmailMessage.send') |
|
|
|
@mock.patch('django.core.mail.EmailMessage.send') |
|
|
|
@mock.patch('finance.views.YandexAvisoView.post', fake_post_fail) |
|
|
|
@mock.patch('finance.views.YandexCheckView.post', fake_post_fail) |
|
|
|
def test_confirm_pay_auto_fail(mocked_email, api_client, bill_yandex, student): |
|
|
|
def test_confirm_pay_auto_fail(mocked_email, api_client, bill_yandex, student): |
|
|
|
assert Progress.objects.count() is 0 |
|
|
|
assert Progress.objects.count() is 0 |
|
|
|
assert ProgressLesson.objects.count() is 0 |
|
|
|
assert ProgressLesson.objects.count() is 0 |
|
|
|
@ -188,7 +188,7 @@ def test_confirm_pay_auto_fail(mocked_email, api_client, bill_yandex, student): |
|
|
|
'shopSumAmount': str(payment.shop_amount) |
|
|
|
'shopSumAmount': str(payment.shop_amount) |
|
|
|
} |
|
|
|
} |
|
|
|
api_client.post( |
|
|
|
api_client.post( |
|
|
|
reverse('yandex_money_notice'), |
|
|
|
reverse('yandex_money_check'), |
|
|
|
data=data, |
|
|
|
data=data, |
|
|
|
status=status.HTTP_200_OK |
|
|
|
status=status.HTTP_200_OK |
|
|
|
) |
|
|
|
) |
|
|
|
|