Specifically test saving with the gzip middleware.

This commit is contained in:
Jannis Leidel
2013-05-27 12:52:17 +02:00
parent b3bead6be3
commit d557654d34
2 changed files with 7 additions and 0 deletions

2
.gitignore vendored
View File

@@ -2,6 +2,8 @@ build
compressor/tests/static/CACHE
compressor/tests/static/custom
compressor/tests/static/js/066cd253eada.js
compressor/tests/static/test.txt*
dist
MANIFEST
*.pyc

View File

@@ -29,6 +29,11 @@ class StorageTestCase(TestCase):
storage.default_storage = self.default_storage
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):
template = """{% load compress %}{% compress css %}
<link rel="stylesheet" href="{{ STATIC_URL }}css/one.css" type="text/css">