Specifically test saving with the gzip middleware.
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -2,6 +2,8 @@ build
|
|||||||
compressor/tests/static/CACHE
|
compressor/tests/static/CACHE
|
||||||
compressor/tests/static/custom
|
compressor/tests/static/custom
|
||||||
compressor/tests/static/js/066cd253eada.js
|
compressor/tests/static/js/066cd253eada.js
|
||||||
|
compressor/tests/static/test.txt*
|
||||||
|
|
||||||
dist
|
dist
|
||||||
MANIFEST
|
MANIFEST
|
||||||
*.pyc
|
*.pyc
|
||||||
|
@@ -29,6 +29,11 @@ class StorageTestCase(TestCase):
|
|||||||
storage.default_storage = self.default_storage
|
storage.default_storage = self.default_storage
|
||||||
settings.COMPRESS_ENABLED = self.old_enabled
|
settings.COMPRESS_ENABLED = self.old_enabled
|
||||||
|
|
||||||
|
def test_gzip_storage(self):
|
||||||
|
storage.default_storage.save('test.txt', ContentFile('yeah yeah'))
|
||||||
|
self.assertTrue(os.path.exists(os.path.join(settings.COMPRESS_ROOT, 'test.txt')))
|
||||||
|
self.assertTrue(os.path.exists(os.path.join(settings.COMPRESS_ROOT, 'test.txt.gz')))
|
||||||
|
|
||||||
def test_css_tag_with_storage(self):
|
def test_css_tag_with_storage(self):
|
||||||
template = """{% load compress %}{% compress css %}
|
template = """{% load compress %}{% compress css %}
|
||||||
<link rel="stylesheet" href="{{ STATIC_URL }}css/one.css" type="text/css">
|
<link rel="stylesheet" href="{{ STATIC_URL }}css/one.css" type="text/css">
|
||||||
|
Reference in New Issue
Block a user