allows using messaging instead of verify_email.html to pass tests
authorCaleb Forbes Davis V <caldavis@gmail.com>
Tue, 5 Jul 2011 01:04:00 +0000 (20:04 -0500)
committerCaleb Forbes Davis V <caldavis@gmail.com>
Tue, 5 Jul 2011 01:04:00 +0000 (20:04 -0500)
* re-instated verification_successful flag
* modified test_auth to verify nav to user_pages/user.html template

mediagoblin/auth/views.py
mediagoblin/tests/test_auth.py

index 435ad803dfc4140e15080808976f963e6ab384c3..47707ca5a63a5b4a1d3dac337bb53d2184ec8cf2 100644 (file)
@@ -126,11 +126,13 @@ def verify_email(request):
         user['status'] = u'active'
         user['email_verified'] = True
         user.save()
+        verification_successful = True
         messages.add_message(request, 
                              messages.SUCCESS, 
                             'Your email address has been verified. ' \
                             'You may now login!')
     else:
+        verification_successful = False
         messages.add_message(request, 
                              messages.ERROR, 
                             'The verification key or user id is incorrect')   
@@ -138,7 +140,8 @@ def verify_email(request):
     return render_to_response(
         request,
         'mediagoblin/user_pages/user.html',
-        {'user': user})
+        {'user': user,
+        'verification_successful' : verification_successful})
 
 
 def resend_activation(request):
index 3a13cbb10337e18ae4b7d3ec3308cee00c21b4d9..ad9dd35b4906f993884b1b9c59ab0feeb42017a9 100644 (file)
@@ -189,7 +189,7 @@ def test_register_views(test_app):
         "/auth/verify_email/?userid=%s&token=total_bs" % unicode(
             new_user['_id']))
     context = util.TEMPLATE_TEST_CONTEXT[
-        'mediagoblin/auth/verify_email.html']
+        'mediagoblin/user_pages/user.html']
     assert context['verification_successful'] == False
     new_user = mg_globals.database.User.find_one(
         {'username': 'happygirl'})
@@ -201,7 +201,7 @@ def test_register_views(test_app):
     util.clear_test_template_context()
     test_app.get("%s?%s" % (path, get_params))
     context = util.TEMPLATE_TEST_CONTEXT[
-        'mediagoblin/auth/verify_email.html']
+        'mediagoblin/user_pages/user.html']
     assert context['verification_successful'] == True
     new_user = mg_globals.database.User.find_one(
         {'username': 'happygirl'})