Skip to content

Commit

Permalink
added unit tests for success url property
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesstottmoj committed Apr 9, 2024
1 parent 1f281e4 commit c0f56ee
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/test_oidc.py
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

0 comments on commit c0f56ee

Please sign in to comment.