From 72b57cf3daf8724d29e9d7a085c44cdd7ad04bc3 Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Mon, 28 Sep 2020 14:49:08 +0200 Subject: [PATCH] Tests: set request method to POST in a way that works on Plone 6 as well. --- Products/CMFFormController/tests/testRedirectTo.py | 3 ++- news/3057.bugfix | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 news/3057.bugfix diff --git a/Products/CMFFormController/tests/testRedirectTo.py b/Products/CMFFormController/tests/testRedirectTo.py index 4424014..35a9628 100644 --- a/Products/CMFFormController/tests/testRedirectTo.py +++ b/Products/CMFFormController/tests/testRedirectTo.py @@ -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 @@ -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 diff --git a/news/3057.bugfix b/news/3057.bugfix new file mode 100644 index 0000000..3f3971f --- /dev/null +++ b/news/3057.bugfix @@ -0,0 +1,2 @@ +Tests: set request method to POST in a way that works on Plone 6 as well. +[maurits]