Skip to content
This repository has been archived by the owner on Jul 29, 2020. It is now read-only.

Commit

Permalink
Use a properly lazy object for the gzip storage test.
Browse files Browse the repository at this point in the history
  • Loading branch information
jezdez committed May 27, 2013
1 parent a74035f commit 0549c0f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions compressor/tests/test_storages.py
Expand Up @@ -5,20 +5,25 @@
from django.core.files.base import ContentFile
from django.core.files.storage import get_storage_class
from django.test import TestCase
from django.utils.functional import LazyObject

from compressor import storage
from compressor.conf import settings
from compressor.tests.test_base import css_tag
from compressor.tests.test_templatetags import render


class GzipStorage(LazyObject):
def _setup(self):
self._wrapped = get_storage_class('compressor.storage.GzipCompressorFileStorage')()


class StorageTestCase(TestCase):
def setUp(self):
self.old_enabled = settings.COMPRESS_ENABLED
settings.COMPRESS_ENABLED = True
self.default_storage = storage.default_storage
storage.default_storage = get_storage_class(
'compressor.storage.GzipCompressorFileStorage')()
storage.default_storage = GzipStorage()

def tearDown(self):
storage.default_storage = self.default_storage
Expand Down

0 comments on commit 0549c0f

Please sign in to comment.