'Test that post_processing indicates the origin of the error when it
fails. Regression test for #18986.'

@override_settings(STATICFILES_DIRS=(os.path.join(TEST_ROOT, u'project', u'faulty'),), STATICFILES_FINDERS=(u'django.contrib.staticfiles.finders.FileSystemFinder',))
def test_post_processing_failure(self):

    finders._finders.clear()
    err = six.StringIO()
    with self.assertRaises(Exception) as cm:
        call_command(u'collectstatic', interactive=False, verbosity=0, stderr=err)
    self.assertEqual(u"Post-processing    'faulty.css'    failed!\n\n", err.getvalue())
