-
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.
added unit tests for success url property
- Loading branch information
1 parent
1f281e4
commit c0f56ee
Showing
1 changed file
with
21 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import pytest | ||
from controlpanel.oidc import StateMismatchHandler | ||
from unittest.mock import Mock | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"email, success_url", | ||
[ | ||
("", "/"), | ||
("[email protected]", "/tools/"), | ||
], | ||
) | ||
def test_success_url(users, email, success_url): | ||
request = Mock() | ||
request.session.get.return_value = "/tools/" | ||
user = users["normal_user"] | ||
user.justice_email = email | ||
view = StateMismatchHandler() | ||
view.request = request | ||
view.user = user | ||
assert view.success_url == success_url |