I\'m using flask to do register and login:
from flask.ext.security.views import register, login class Register(Resource): def post(self): return
It's a known flask problem. You receive two exceptions instead one. Simply add PRESERVE_CONTEXT_ON_EXCEPTION = False to your test config.
PRESERVE_CONTEXT_ON_EXCEPTION = False