From c7815e48781b6d3a457eaff1808d179402558f8c Mon Sep 17 00:00:00 2001 From: 0livd Date: Sun, 6 Aug 2017 04:06:21 +0200 Subject: Fix #248: Database creation issue (#254) In flask's development server, the route handlers run in a different thread than the main thread thus an in-memory database created in the main thread cannot be acccessed by the route handlers. Switching the default database location to a temporary file solves the isssue. See full explanation here: https://gehrcke.de/2015/05/in-memory-sqlite-database-and-flask-a-threading-trap/ --- ihatemoney/tests/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ihatemoney/tests') diff --git a/ihatemoney/tests/tests.py b/ihatemoney/tests/tests.py index cb92756..5fc45a7 100644 --- a/ihatemoney/tests/tests.py +++ b/ihatemoney/tests/tests.py @@ -77,7 +77,7 @@ class ConfigurationTestCase(BaseTestCase): def test_default_configuration(self): """Test that default settings are loaded when no other configuration file is specified""" self.assertFalse(self.app.config['DEBUG']) - self.assertEqual(self.app.config['SQLALCHEMY_DATABASE_URI'], 'sqlite://') + self.assertEqual(self.app.config['SQLALCHEMY_DATABASE_URI'], 'sqlite:////tmp/ihatemoney.db') self.assertFalse(self.app.config['SQLALCHEMY_TRACK_MODIFICATIONS']) self.assertEqual(self.app.config['MAIL_DEFAULT_SENDER'], ("Budget manager", "budget@notmyidea.org")) -- cgit v1.1