From: ayleph Date: Wed, 22 Oct 2014 14:27:56 +0000 (-0700) Subject: Updates per request of moggers87 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8cf9d643289e84b9302036153b230d32d516fa99;p=mediagoblin.git Updates per request of moggers87 --- diff --git a/mediagoblin/tests/test_auth.py b/mediagoblin/tests/test_auth.py index a3e2cac9..5ce67688 100644 --- a/mediagoblin/tests/test_auth.py +++ b/mediagoblin/tests/test_auth.py @@ -233,22 +233,6 @@ def test_register_views(test_app): assert urlparse.urlsplit(response.location)[2] == '/' assert 'mediagoblin/root.html' in template.TEMPLATE_TEST_CONTEXT - ## Verify that username is lowercased on login attempt - template.clear_test_template_context() - response = test_app.post( - '/auth/login/', { - 'username': u'ANGRYGIRL', - 'password': 'iamveryveryangry'}) - - # Username should no longer be uppercased; it should be lowercased - assert not form.username.data == u'ANGRYGIRL' - assert form.username.data == u'angrygirl' - - # User should be redirected - response.follow() - assert urlparse.urlsplit(response.location)[2] == '/' - assert 'mediagoblin/root.html' in template.TEMPLATE_TEST_CONTEXT - def test_authentication_views(test_app): """ Test logging in and logging out @@ -351,6 +335,19 @@ def test_authentication_views(test_app): 'next' : '/u/chris/'}) assert urlparse.urlsplit(response.location)[2] == '/u/chris/' + ## Verify that username is lowercased on login attempt + template.clear_test_template_context() + response = test_app.post( + '/auth/login/', { + 'username': u'ANDREW', + 'password': 'fuselage'}) + context = template.TEMPLATE_TEST_CONTEXT['mediagoblin/auth/login.html'] + form = context['login_form'] + + # Username should no longer be uppercased; it should be lowercased + assert not form.username.data == u'ANDREW' + assert form.username.data == u'andrew' + @pytest.fixture() def authentication_disabled_app(request): return get_app(