-
Notifications
You must be signed in to change notification settings - Fork 90
Sessions are empty when testing #69
Copy link
Copy link
Open
Description
This doc expresses that we can access session without any extra context manager.
However the following code does not return any session key (session is empty):
from flask import Flask
import pytest
from flask import session
myapp = Flask('testing')
myapp.secret_key = 'secret'
myapp.debug = True
@myapp.route('/')
def home():
return session['message']
@pytest.fixture
def app():
return myapp
def test_home(client):
session['message'] = 'something'
response = client.get('/')
assert response.data == 'something'Any hint on what we're missing here?
Thanks :)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels