From aa951eb8ea5e3986ed8b76f55f5f4741eec0e717 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sat, 30 Oct 2010 23:39:53 +0000 Subject: Ensure that the staticfiles tests use the MEDIA_ROOT they intended, also use a more approrpiate datastructure in collectstatic. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14401 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/staticfiles_tests/tests.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/regressiontests/staticfiles_tests/tests.py b/tests/regressiontests/staticfiles_tests/tests.py index 6999b7af30..0a6c060664 100644 --- a/tests/regressiontests/staticfiles_tests/tests.py +++ b/tests/regressiontests/staticfiles_tests/tests.py @@ -7,12 +7,13 @@ from StringIO import StringIO from django.test import TestCase from django.conf import settings +from django.contrib.staticfiles import finders, storage +from django.core.files.storage import default_storage from django.core.exceptions import ImproperlyConfigured from django.core.management import call_command from django.db.models.loading import load_app from django.template import Template, Context -from django.contrib.staticfiles import finders, storage TEST_ROOT = os.path.dirname(__file__) @@ -54,6 +55,11 @@ class StaticFilesTestCase(TestCase): "regressiontests.staticfiles_tests", ] + # Clear the cached default_storage out, this is because when it first + # gets accessed (by some other test), it evaluates settings.MEDIA_ROOT, + # since we're planning on changing that we need to clear out the cache. + default_storage._wrapped = None + def tearDown(self): settings.DEBUG = self.old_debug settings.MEDIA_ROOT = self.old_media_root -- cgit v1.3