From 1a04b5b0428db2721a2efb88889ef48ac07ea865 Mon Sep 17 00:00:00 2001 From: vangheem Date: Fri, 8 May 2015 12:06:29 -0500 Subject: [PATCH] fix test failures with csrf protection and locking behavior --- plone/app/discussion/tests/functional_test_comments.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plone/app/discussion/tests/functional_test_comments.txt b/plone/app/discussion/tests/functional_test_comments.txt index b90f479..1d85365 100644 --- a/plone/app/discussion/tests/functional_test_comments.txt +++ b/plone/app/discussion/tests/functional_test_comments.txt @@ -464,7 +464,13 @@ Login as admin. Edit the content object. - >>> browser.open("http://nohost/plone/doc1/edit") + >>> from plone.protect.authenticator import _getKeyring + >>> import hmac + >>> from hashlib import sha1 as sha + >>> ring = _getKeyring('foo') + >>> secret = ring.random() + >>> token = hmac.new(secret, 'admin', sha).hexdigest() + >>> browser.open("http://nohost/plone/doc1/edit?_authenticator=" + token) >>> browser.getControl(name='form.widgets.IRichText.text').value = "Lorem ipsum" >>> browser.getControl('Save').click()