def test_user_not_found(self):
     user = User.testing_create()
     jwt_auth = auth.JwtRequestLoader(flask.current_app)
     token = jwt_auth.create_access_token(user)
     User.delete_cascaded()
     with mock.patch.dict(
         flask.current_app.config,
         JWT_TOKEN_LOCATION='query_string',
         JWT_QUERY_STRING_NAME='jwt',
     ):
         with flask.current_app.test_request_context('/?jwt={}'.format(token)):
             assert jwt_auth.get_authenticated_user() is None
Example #2
0
 def setup_method(self, _):
     User.delete_cascaded()
     UserNoEmail.delete_cascaded()