From 597d659a6878c748b9573b1e9e15f16bf11e95d6 Mon Sep 17 00:00:00 2001 From: Andre Anjos <andre.dos.anjos@gmail.com> Date: Fri, 22 Apr 2016 14:29:29 +0200 Subject: [PATCH] [common] Remove prefix and cache after tests --- beat/web/common/testutils.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/beat/web/common/testutils.py b/beat/web/common/testutils.py index 286ff29f1..ccb7683ec 100644 --- a/beat/web/common/testutils.py +++ b/beat/web/common/testutils.py @@ -25,7 +25,11 @@ # # ############################################################################### +import os +import shutil + from django.test import TestCase +from django.conf import settings from urlparse import urlparse @@ -38,6 +42,15 @@ class BaseTestCase(TestCase): class Meta: model = None + + def tearDown(): + + if os.path.exists(settings.CACHE_ROOT): + shutil.rmtree(settings.CACHE_ROOT) + if os.path.exists(settings.PREFIX): + shutil.rmtree(settings.PREFIX) + + def checkObjectDBSharingPreferences(self, contribution, reference): if not(reference.has_key('status')): reference['status'] = 'private' -- GitLab