vimalloc/flask-jwt-extended

Tests fails

eamanu opened this issue · 2 comments

HI,

I'm working in the Debian packaging of flask-jwt-extended 4.4.3. And during the build I have this
error tests:

__________________________________________________ test_add_context_processor ______________________________________________________

app = <Flask 'tests.test_add_context_processor'>

    def test_add_context_processor(app):
        jwt_manager = JWTManager(app, add_context_processor=True)
    
        @jwt_manager.user_lookup_loader
        def user_lookup_callback(_jwt_header, _jwt_data):
            return "test_user"
    
        test_client = app.test_client()
    
        with app.test_request_context():
            access_token = create_access_token("username")
    
        access_headers = {"Authorization": "Bearer {}".format(access_token)}
        response = test_client.get("/context_current_user", headers=access_headers)
>       assert response.text == "test_user"
E       AttributeError: 'WrapperTestResponse' object has no attribute 'text'

tests/test_add_context_processor.py:37: AttributeError
____________________________________________________ test_no_add_context_processor ____________________________________________________

app = <Flask 'tests.test_add_context_processor'>

    def test_no_add_context_processor(app):
        jwt_manager = JWTManager(app)
    
        @jwt_manager.user_lookup_loader
        def user_lookup_callback(_jwt_header, _jwt_data):
            return "test_user"
    
        test_client = app.test_client()
    
        with app.test_request_context():
            access_token = create_access_token("username")
    
        access_headers = {"Authorization": "Bearer {}".format(access_token)}
        response = test_client.get("/context_current_user", headers=access_headers)
>       assert response.text == ""
E       AttributeError: 'WrapperTestResponse' object has no attribute 'text'

tests/test_add_context_processor.py:54: AttributeError

Oh, I figure out the issue. I'm using an old flask version.

sorry for the noise

Glad you got it figure out! Thanks for maintaining the package!! 😊