Fixed the ``repoze.who.plugins.form.make_plugin`` factory's ``formcallable``
argument handling, to allow passing in a dotted name (e.g., from a config
file).
| | |
| | | repoze.who Changelog |
| | | ==================== |
| | | |
| | | After 1.0.16 |
| | | ------------ |
| | | |
| | | - Fixed the ``repoze.who.plugins.form.make_plugin`` factory's ``formcallable`` |
| | | argument handling, to allow passing in a dotted name (e.g., from a config |
| | | file). |
| | | |
| | | 1.0.16 (2009-11-04) |
| | | ------------------- |
| | | |
| | |
| | | |
| | | from zope.interface import implements |
| | | |
| | | from repoze.who.config import _resolve |
| | | from repoze.who.interfaces import IChallenger |
| | | from repoze.who.interfaces import IIdentifier |
| | | |
| | |
| | | 'must include rememberer key (name of another IIdentifier plugin)') |
| | | if form is not None: |
| | | form = open(form).read() |
| | | if isinstance(formcallable, str): |
| | | formcallable = _resolve(formcallable) |
| | | plugin = FormPlugin(login_form_qs, rememberer_name, form, formcallable) |
| | | return plugin |
| | | |
| | |
| | | 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) |
| | | dotted='repoze.who.plugins.tests.test_form:sample_formcallable' |
| | | plugin = self._callFUT('__login', 'cookie', |
| | | formcallable=dotted |
| | | ) |
| | | self.assertEqual(plugin.formcallable, sample_formcallable) |
| | | |
| | | def sample_formcallable(environ): |
| | | return {'foo': 'bar'} |
| | | |
| | | |
| | | class TestRedirectingFormPlugin(unittest.TestCase): |