--
Ticket URL: <https://code.djangoproject.com/ticket/29464>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* type: Uncategorized => Cleanup/optimization
* version: 2.0 => 2.1
* component: Core (Management commands) => contrib.staticfiles
Comment:
(Follow up to #28973.)
--
Ticket URL: <https://code.djangoproject.com/ticket/29464#comment:1>
* easy: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/29464#comment:2>
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/29464#comment:3>
* owner: nobody => arthurspa
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/29464#comment:4>
Comment (by Arthur Silva):
Hi @Tim Graham,
How can I test post_process inside TestCollectionVerbosity class located
in django/tests/staticfiles_tests/test_management.py ?
I've tried:
{{{
def test_verbosity_1(self):
stdout = StringIO()
self.run_collectstatic(verbosity=1, stdout=stdout,
post_process=True)
output = stdout.getvalue()
self.assertIn(self.staticfiles_copied_msg, output)
self.assertNotIn(self.copying_msg, output)
self.assertNotIn(self.post_process_msg, output)
}}}
where self.post_process_msg is equal to 'Post-process'.
However I can't make post_process be triggered. So, the test passes even
message post_process_msg is printed with verbose=1.
I may be missing some 'storage' initialization.
Can you give a hint, please?
Thanks.
--
Ticket URL: <https://code.djangoproject.com/ticket/29464#comment:5>
Comment (by David Szotten):
you probably need to enable a storage backend that uses post processing,
e.g. using
{{{
@override_settings(STATICFILES_STORAGE='django.contrib.staticfiles.storage.CachedStaticFilesStorage')
def test_foo(self):
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29464#comment:6>
* status: assigned => closed
* resolution: => fixed
Comment:
Thanks David.
I've submitted a [https://github.com/django/django/pull/10042 PR].
--
Ticket URL: <https://code.djangoproject.com/ticket/29464#comment:7>
* status: closed => new
* has_patch: 0 => 1
* resolution: fixed =>
Comment:
The ticket is closed when the PR is merged. You should instead check "Has
patch" when adding a pull request.
--
Ticket URL: <https://code.djangoproject.com/ticket/29464#comment:8>
Comment (by Arthur Silva):
My bad.
Thanks for changing it to "Has patch".
--
Ticket URL: <https://code.djangoproject.com/ticket/29464#comment:9>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"bc1435551c0cfaf4a22aff8216990b909005dba9" bc143555]:
{{{
#!CommitTicketReference repository=""
revision="bc1435551c0cfaf4a22aff8216990b909005dba9"
Fixed #29464 -- Silenced post-process messages in collectstatic's default
verbosity.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29464#comment:10>
Comment (by Tim Graham <timograham@…>):
In [changeset:"91a02dce97ec677933527deddcce230e6e7ba7c9" 91a02dce]:
{{{
#!CommitTicketReference repository=""
revision="91a02dce97ec677933527deddcce230e6e7ba7c9"
[2.1.x] Fixed #29464 -- Silenced post-process messages in collectstatic's
default verbosity.
Backport of bc1435551c0cfaf4a22aff8216990b909005dba9 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29464#comment:11>