Commit 0db06ec1 by Timothée Peignier

Merge pull request #537 from davidt/glob-exists

Don't filter out "missing" files in the glob stage.
parents 373a0f3c b2be56f9
......@@ -25,12 +25,7 @@ def iglob(pathname):
"""
if not has_magic(pathname):
try:
if staticfiles_storage.exists(pathname):
yield pathname
except NotImplementedError:
# Being optimistic
yield pathname
yield pathname
return
dirname, basename = os.path.split(pathname)
if not dirname:
......
......@@ -55,7 +55,6 @@ class GlobTest(TestCase):
self.assertSequenceEqual(self.glob('a'), [self.normpath('a')])
self.assertSequenceEqual(self.glob('a', 'D'), [self.normpath('a', 'D')])
self.assertSequenceEqual(self.glob('aab'), [self.normpath('aab')])
self.assertSequenceEqual(self.glob('zymurgy'), [])
def test_glob_one_directory(self):
self.assertSequenceEqual(
......
......@@ -6,6 +6,7 @@ from django.core.management import call_command
from django.test import TestCase
from django.test.utils import override_settings, modify_settings
from pipeline.collector import default_collector
from pipeline.storage import PipelineStorage
from tests.tests.test_compiler import DummyCompiler
......@@ -49,11 +50,13 @@ class StorageTest(TestCase):
@pipeline_settings(JS_COMPRESSOR=None, CSS_COMPRESSOR=None)
def test_post_process_dry_run(self):
default_collector.collect()
processed_files = PipelineStorage().post_process({}, True)
self.assertEqual(list(processed_files), [])
@pipeline_settings(JS_COMPRESSOR=None, CSS_COMPRESSOR=None)
@pipeline_settings(JS_COMPRESSOR=None, CSS_COMPRESSOR=None, COMPILERS=['tests.tests.test_storage.DummyCSSCompiler'])
def test_post_process(self):
default_collector.collect()
storage = PipelineStorage()
processed_files = storage.post_process({})
self.assertTrue(('screen.css', 'screen.css', True) in processed_files)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment