## Did we redirect to the proper page? Use the right template?
assert_equal(
urlparse.urlsplit(response.location)[2],
- '/auth/register/success/')
+ '/u/happygirl/')
assert util.TEMPLATE_TEST_CONTEXT.has_key(
- 'mediagoblin/auth/register_success.html')
+ 'mediagoblin/user_pages/user.html')
## Make sure user is in place
new_user = mg_globals.database.User.find_one(
assert new_user['status'] == u'needs_email_verification'
assert new_user['email_verified'] == False
+ ## Make sure user is logged in
+ request = util.TEMPLATE_TEST_CONTEXT[
+ 'mediagoblin/user_pages/user.html']['request']
+ assert request.session['user_id'] == unicode(new_user['_id'])
+
## Make sure we get email confirmation, and try verifying
assert len(util.EMAIL_TEST_INBOX) == 1
message = util.EMAIL_TEST_INBOX.pop()
## Try verifying with bs verification key, shouldn't work
util.clear_test_template_context()
- test_app.get(
+ response = test_app.get(
"/auth/verify_email/?userid=%s&token=total_bs" % unicode(
new_user['_id']))
+ response.follow()
context = util.TEMPLATE_TEST_CONTEXT[
- 'mediagoblin/auth/verify_email.html']
- assert context['verification_successful'] == False
+ 'mediagoblin/user_pages/user.html']
+ # assert context['verification_successful'] == True
+ # TODO: Would be good to test messages here when we can do so...
new_user = mg_globals.database.User.find_one(
{'username': 'happygirl'})
assert new_user
## Verify the email activation works
util.clear_test_template_context()
- test_app.get("%s?%s" % (path, get_params))
+ response = test_app.get("%s?%s" % (path, get_params))
+ response.follow()
context = util.TEMPLATE_TEST_CONTEXT[
- 'mediagoblin/auth/verify_email.html']
- assert context['verification_successful'] == True
+ 'mediagoblin/user_pages/user.html']
+ # assert context['verification_successful'] == True
+ # TODO: Would be good to test messages here when we can do so...
new_user = mg_globals.database.User.find_one(
{'username': 'happygirl'})
assert new_user