-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from plone/repatch-pluggableauth
change pluggable auth patches to marmoset
- Loading branch information
Showing
4 changed files
with
47 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from plone.app.testing import SITE_OWNER_NAME | ||
from plone.app.testing import SITE_OWNER_PASSWORD | ||
from plone.protect.testing import PROTECT_FUNCTIONAL_TESTING | ||
from plone.testing.z2 import Browser | ||
import unittest2 as unittest | ||
|
||
|
||
class TestCSRF(unittest.TestCase): | ||
layer = PROTECT_FUNCTIONAL_TESTING | ||
|
||
def setUp(self): | ||
self.portal = self.layer['portal'] | ||
self.browser = Browser(self.layer['app']) | ||
self.request = self.layer['request'] | ||
self.browser.addHeader( | ||
'Authorization', 'Basic %s:%s' % (SITE_OWNER_NAME, SITE_OWNER_PASSWORD,)) | ||
|
||
def test_change_password_on_root_does_not_throw_other_csrf_protection(self): | ||
self.browser.open('%s/acl_users/users/manage_users?user_id=%s&passwd=1' % ( | ||
self.layer['app'].absolute_url(), SITE_OWNER_NAME)) | ||
self.browser.getControl(name='password').value = SITE_OWNER_PASSWORD | ||
self.browser.getControl(name='confirm').value = SITE_OWNER_PASSWORD | ||
self.browser.getForm().submit() | ||
self.assertEquals( | ||
self.browser.url, | ||
'%s/acl_users/users/manage_users?manage_tabs_message=password+updated' % ( | ||
self.layer['app'].absolute_url())) |