コード例 #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)
コード例 #2
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)
コード例 #3
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)
コード例 #4
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)