Exemplo n.º 1
0
    def test_new_delayed_construction_with_default(self):
        app = Flask(__name__)

        ext = KVSessionExtension(self.store)
        ext.init_app(app)

        self.assertIs(self.store, app.kvsession_store)
Exemplo n.º 2
0
    def test_new_delayed_construction(self):
        app = Flask(__name__)

        ext = KVSessionExtension()

        with self.assertRaises(ValueError):
            ext.init_app(app)

        ext.init_app(app, self.store)

        self.assertIs(self.store, app.kvsession_store)