Skip to content

Commit

Permalink
Tests: set request method to POST in a way that works on Plone 6 as w…
Browse files Browse the repository at this point in the history
…ell.
  • Loading branch information
mauritsvanrees committed Sep 28, 2020
1 parent 8abf259 commit 72b57cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Products/CMFFormController/tests/testRedirectTo.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from plone.app.testing import TEST_USER_ID
from plone.app.testing import TEST_USER_NAME
from plone.app.testing import TEST_USER_PASSWORD
from plone.testing.zope import Browser
from plone.protect import createToken
from plone.testing.z2 import Browser

import transaction
import unittest
Expand Down Expand Up @@ -98,6 +98,7 @@ def test_attacker_redirect(self):

# The same without the testbrowser
self.assertIsNone(self.request.response.headers.get('location'))
self.request.environ["REQUEST_METHOD"] = "POST"
self.request.REQUEST_METHOD = 'POST'
self.request.form['workflow_action'] = 'publish'
self.request.form['paths'] = path
Expand Down
2 changes: 2 additions & 0 deletions news/3057.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Tests: set request method to POST in a way that works on Plone 6 as well.
[maurits]

0 comments on commit 72b57cf

Please sign in to comment.