From 5f570c006869f400d0ffe665e044fbe0ffe6424d Mon Sep 17 00:00:00 2001 From: Samuel Gaist <samuel.gaist@idiap.ch> Date: Thu, 9 Apr 2020 17:54:12 +0200 Subject: [PATCH] [settings][test] Use the full path to the database as database name This mimicks the Linux behaviour and allows to properly run the beat/beat.cmdline tests on macOS. --- beat/web/settings/test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/beat/web/settings/test.py b/beat/web/settings/test.py index 8ac050df7..1abd6fa8a 100755 --- a/beat/web/settings/test.py +++ b/beat/web/settings/test.py @@ -48,7 +48,9 @@ if platform.system() == "Linux": database_name = os.path.join(shm_path, "test.sqlite3") else: - database_name = "test.sqlite3" + here = os.path.dirname(os.path.realpath(__file__)) + database_name = os.path.join(here, "test.sqlite3") + DATABASES["default"]["NAME"] = database_name # noqa DATABASES["default"]["TEST"] = {"NAME": DATABASES["default"]["NAME"]} # noqa DATABASES["default"]["OPTIONS"]["timeout"] = 30 # noqa -- GitLab