-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unit test for Success and Cancel endpoints in payment app
- Loading branch information
Showing
3 changed files
with
26 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import pytest | ||
from rest_framework.test import force_authenticate, APIRequestFactory | ||
from payment.views import SuccessView, CancelView | ||
|
||
factory = APIRequestFactory() | ||
|
||
|
||
@pytest.mark.django_db | ||
def test_success_return_success_view(): | ||
request = factory.get("/payment/success") | ||
response = SuccessView.as_view()(request) | ||
assert response.status_code == 200 | ||
|
||
|
||
|
||
@pytest.mark.django_db | ||
def test_success_return_cancel_view(): | ||
request = factory.get("/payment/cancel") | ||
response = CancelView.as_view()(request) | ||
assert response.status_code == 200 |