def METHOD_NAME(self):
    app = flask.Flask(__name__)
    app.testing = True
    app.secret_key = 'testing'
    @app.route('/')
    def index():
        return text_type(flask.session['foo'])
    with app.test_client() as c:
        with c.session_transaction() as sess:
            self.assert_equal(len(sess), 0)
            sess['foo'] = [42]
            self.assert_equal(len(sess), 1)
        rv = c.get('/')
        self.assert_equal(rv.data, b'[42]')
        with c.session_transaction() as sess:
            self.assert_equal(len(sess), 1)
            self.assert_equal(sess['foo'], [42])