Hi, Please review the attached patch.
Cheers, Christophe
>From 2fa4bbb478f6c2164caae90b898e5efef5a9a9e3 Mon Sep 17 00:00:00 2001 From: Christophe Siraut <d...@tobald.eu.org> Date: Wed, 9 Jul 2014 13:56:31 +0200 Subject: [PATCH] Fix the tests to not pollute the data directory --- distro_tracker/project/settings/test.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/distro_tracker/project/settings/test.py b/distro_tracker/project/settings/test.py index 586b9f7..168bbbc 100644 --- a/distro_tracker/project/settings/test.py +++ b/distro_tracker/project/settings/test.py @@ -1,5 +1,6 @@ """Appropriate settings to run the test suite.""" - +import os +import shutil from .development import * # Don't use bcrypt to run tests (speed gain) @@ -18,3 +19,12 @@ INSTALLED_APPS += ( 'distro_tracker.vendor', 'distro_tracker.vendor.debian', ) + +# Use an temporary data path +# Note TestCase does not reset the cache yet, +# see https://code.djangoproject.com/ticket/11505 +DISTRO_TRACKER_DATA_PATH = '/tmp/distro-tracker' +if os.path.exists(DISTRO_TRACKER_DATA_PATH): + shutil.rmtree(DISTRO_TRACKER_DATA_PATH) +for directory in ('keyring', 'cache'): + os.makedirs(os.path.join(DISTRO_TRACKER_DATA_PATH, directory)) -- 1.7.10.4