Exposed ``formcallable`` argument for ``repoze.who.plugins.form.FormPlugin``
to the callers of the ``repoze.who.plugins.form.make_plugin`` factory.
Thanks to Roland Hedburg for the report.
| | |
| | | Next release |
| | | ------------ |
| | | |
| | | - Fixed an issue that caused the following symptom when using the |
| | | ini configuration parser: |
| | | - Exposed ``formcallable`` argument for ``repoze.who.plugins.form.FormPlugin`` |
| | | to the callers of the ``repoze.who.plugins.form.make_plugin`` factory. |
| | | Thanks to Roland Hedburg for the report. |
| | | |
| | | TypeError: _makePlugin() got multiple values for keyword argument 'name' |
| | | - Fixed an issue that caused the following symptom when using the |
| | | ini configuration parser:: |
| | | |
| | | TypeError: _makePlugin() got multiple values for keyword argument 'name' |
| | | |
| | | See http://bugs.repoze.org/issue92 for more details. Thanks to vaab |
| | | for the bug report and initial fix. |
| | |
| | | headers = headers + forget_headers + cookies |
| | | return HTTPFound(headers=headers) |
| | | |
| | | def make_plugin(login_form_qs='__do_login', rememberer_name=None, form=None): |
| | | def make_plugin(login_form_qs='__do_login', |
| | | rememberer_name=None, |
| | | form=None, |
| | | formcallable=None, |
| | | ): |
| | | if rememberer_name is None: |
| | | raise ValueError( |
| | | 'must include rememberer key (name of another IIdentifier plugin)') |
| | | if form is not None: |
| | | form = open(form).read() |
| | | plugin = FormPlugin(login_form_qs, rememberer_name, form) |
| | | plugin = FormPlugin(login_form_qs, rememberer_name, form, formcallable) |
| | | return plugin |
| | | |
| | | def make_redirecting_plugin(login_form_url=None, |
| | |
| | | self.assertEqual(plugin.login_form_qs, '__login') |
| | | self.assertEqual(plugin.rememberer_name, 'cookie') |
| | | self.assertEqual(plugin.formbody, formbody) |
| | | self.assertEqual(plugin.formcallable, None) |
| | | |
| | | def test_default_form(self): |
| | | plugin = self._callFUT('__login', 'cookie') |
| | | self.assertEqual(plugin.login_form_qs, '__login') |
| | | self.assertEqual(plugin.rememberer_name, 'cookie') |
| | | self.assertEqual(plugin.formbody, None) |
| | | self.assertEqual(plugin.formcallable, None) |
| | | |
| | | def test_with_formcallable(self): |
| | | def _callable(environ): |
| | | return {'foo': 'bar'} |
| | | plugin = self._callFUT('__login', 'cookie', formcallable=_callable) |
| | | self.assertEqual(plugin.formcallable, _callable) |
| | | |
| | | |
| | | class TestRedirectingFormPlugin(unittest.TestCase): |
| | | |