From 1caa9de6286c5575accb05b942531080142242d3 Mon Sep 17 00:00:00 2001 From: accraze Date: Mon, 19 Dec 2016 08:03:37 -0800 Subject: [PATCH] Added missing testing config fixes #1302 --- docs/testing.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/testing.rst b/docs/testing.rst index 0737936e..edaa597c 100644 --- a/docs/testing.rst +++ b/docs/testing.rst @@ -98,8 +98,10 @@ test method to our class, like this:: def setUp(self): self.db_fd, flaskr.app.config['DATABASE'] = tempfile.mkstemp() + flaskr.app.config['TESTING'] = True self.app = flaskr.app.test_client() - flaskr.init_db() + with flaskr.app.app_context(): + flaskr.init_db() def tearDown(self): os.close(self.db_fd)