diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2014-09-16 14:01:43 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2014-09-16 14:01:43 -0500 |
commit | f6bad0eb26fa7e092570afe1fb7f38b3d1a1941d (patch) | |
tree | 0ca05e7a95cfb30d8b286f3ec72e8c95e212511b /mediagoblin/tests/test_ldap.py | |
parent | 5b64c92e0816e733c2f88b88ddc0aec070cdc0d3 (diff) | |
parent | 1b4e199668ada5c2ec47df7432ab69e315dc0601 (diff) | |
download | mediagoblin-f6bad0eb26fa7e092570afe1fb7f38b3d1a1941d.tar.lz mediagoblin-f6bad0eb26fa7e092570afe1fb7f38b3d1a1941d.tar.xz mediagoblin-f6bad0eb26fa7e092570afe1fb7f38b3d1a1941d.zip |
Merge branch 'master' into merge-python3-port
Has some issues, will iteratively fix!
Conflicts:
mediagoblin/gmg_commands/__init__.py
mediagoblin/gmg_commands/deletemedia.py
mediagoblin/gmg_commands/users.py
mediagoblin/oauth/views.py
mediagoblin/plugins/api/views.py
mediagoblin/tests/test_api.py
mediagoblin/tests/test_edit.py
mediagoblin/tests/test_oauth1.py
mediagoblin/tests/test_util.py
mediagoblin/tools/mail.py
mediagoblin/webfinger/views.py
setup.py
Diffstat (limited to 'mediagoblin/tests/test_ldap.py')
-rw-r--r-- | mediagoblin/tests/test_ldap.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/mediagoblin/tests/test_ldap.py b/mediagoblin/tests/test_ldap.py index 9164da78..f251d150 100644 --- a/mediagoblin/tests/test_ldap.py +++ b/mediagoblin/tests/test_ldap.py @@ -67,7 +67,8 @@ def test_ldap_plugin(ldap_plugin_app): assert form.username.errors == [u'This field is required.'] assert form.password.errors == [u'This field is required.'] - @mock.patch('mediagoblin.plugins.ldap.tools.LDAP.login', mock.Mock(return_value=return_value())) + @mock.patch('mediagoblin.plugins.ldap.tools.LDAP.login', + mock.Mock(return_value=return_value())) def _test_authentication(): template.clear_test_template_context() res = ldap_plugin_app.post( @@ -75,7 +76,8 @@ def test_ldap_plugin(ldap_plugin_app): {'username': u'chris', 'password': u'toast'}) - context = template.TEMPLATE_TEST_CONTEXT['mediagoblin/auth/register.html'] + context = template.TEMPLATE_TEST_CONTEXT[ + 'mediagoblin/auth/register.html'] register_form = context['register_form'] assert register_form.username.data == u'chris' @@ -89,7 +91,8 @@ def test_ldap_plugin(ldap_plugin_app): res.follow() assert urlparse.urlsplit(res.location)[2] == '/u/chris/' - assert 'mediagoblin/user_pages/user_nonactive.html' in template.TEMPLATE_TEST_CONTEXT + assert 'mediagoblin/user_pages/user_nonactive.html' in \ + template.TEMPLATE_TEST_CONTEXT # Try to register with same email and username template.clear_test_template_context() @@ -98,11 +101,14 @@ def test_ldap_plugin(ldap_plugin_app): {'username': u'chris', 'email': u'chris@example.com'}) - context = template.TEMPLATE_TEST_CONTEXT['mediagoblin/auth/register.html'] + context = template.TEMPLATE_TEST_CONTEXT[ + 'mediagoblin/auth/register.html'] register_form = context['register_form'] - assert register_form.email.errors == [u'Sorry, a user with that email address already exists.'] - assert register_form.username.errors == [u'Sorry, a user with that name already exists.'] + assert register_form.email.errors == [ + u'Sorry, a user with that email address already exists.'] + assert register_form.username.errors == [ + u'Sorry, a user with that name already exists.'] # Log out ldap_plugin_app.get('/auth/logout/') |