Skip to content

Commit

Permalink
Merge 000e1a8 into 57f471b
Browse files Browse the repository at this point in the history
  • Loading branch information
odelaere committed Oct 6, 2020
2 parents 57f471b + 000e1a8 commit 20bc687
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/pas/plugins/imio/tests/test_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,21 @@ def test_usergroup_userprefs(self):
)
self.assertIn('<button type="button"', view())
self.assertIn("Wallonie-Connect", view())

def test_redirect_parameter_before_login(self):
redirect_target = api.content.create(
type="Folder", id="secret", container=self.portal,
)
view = api.content.get_view(
name="imio_login", context=self.portal, request=self.request
)
expected = "http://nohost/plone/authentic-handler/?next_url=/secret"

self.request.set("came_from", redirect_target.absolute_url())
view()
self.assertEqual(expected, self.request.RESPONSE.getHeader("location"))

self.request.set("came_from", None)
self.request.set("HTTP_REFERER", redirect_target.absolute_url())
view()
self.assertEqual(expected, self.request.RESPONSE.getHeader("location"))

0 comments on commit 20bc687

Please sign in to comment.