aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tests
diff options
context:
space:
mode:
authorayleph <ayleph@thisshitistemp.com>2014-10-22 07:27:56 -0700
committerChristopher Allan Webber <cwebber@dustycloud.org>2014-10-30 11:34:23 -0500
commit8cf9d643289e84b9302036153b230d32d516fa99 (patch)
tree473f97e292d2eb3f7a875b407e04fd2c3844d8e9 /mediagoblin/tests
parentc7236fd0da6689c5f6ec5c3deb93f89069470610 (diff)
downloadmediagoblin-8cf9d643289e84b9302036153b230d32d516fa99.tar.lz
mediagoblin-8cf9d643289e84b9302036153b230d32d516fa99.tar.xz
mediagoblin-8cf9d643289e84b9302036153b230d32d516fa99.zip
Updates per request of moggers87
Diffstat (limited to 'mediagoblin/tests')
-rw-r--r--mediagoblin/tests/test_auth.py29
1 files changed, 13 insertions, 16 deletions
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(