request.POST['password'])
user.save(validate=True)
+ # log the user in
+ request.session['user_id'] = unicode(user['_id'])
+ request.session.save()
+
+ # send verification email
send_verification_email(user, request)
+ # give the user a message and redirect
messages.add_message(
request,
messages.INFO,
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()