[Django] #30410: Allow silencing "Adding permission ..." for tests

3 views
Skip to first unread message

Django

unread,
Apr 26, 2019, 12:12:36 PM4/26/19
to django-...@googlegroups.com
#30410: Allow silencing "Adding permission ..." for tests
---------------------------------------------+------------------------
Reporter: Martin Honermeyer | Owner: nobody
Type: New feature | Status: new
Component: Testing framework | Version: 1.11
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
---------------------------------------------+------------------------
In our automated tests, the "Adding permission xxx" lines are congesting
the test output. IMHO there should be a way to disable them, at least for
tests.

I refer to the following line of code:
https://github.com/django/django/blob/181fb60159e54d442d3610f4afba6f066a6dac05/django/contrib/auth/management/__init__.py#L86

--
Ticket URL: <https://code.djangoproject.com/ticket/30410>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 26, 2019, 12:24:58 PM4/26/19
to django-...@googlegroups.com
#30410: Allow silencing "Adding permission ..." for tests
-----------------------------------+--------------------------------------
Reporter: Martin H. | Owner: nobody
Type: New feature | Status: closed

Component: Testing framework | Version: 1.11
Severity: Normal | Resolution: wontfix

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Changes (by Simon Charette):

* status: new => closed
* resolution: => wontfix


Comment:

Unless I'm missing something these messages will only be displayed during
tests if `--verbosity=3` as the test command calls `migrate` with
`verbosity - 1` and these messages are only displayed
[https://github.com/django/django/blob/181fb60159e54d442d3610f4afba6f066a6dac05/django/contrib/auth/management/__init__.py#L84-L86
if verbosity >=2] just like content type creation message.

Given `--verbosity=3` is the maximum level and should be synonym of
''print everything'' I don't think adding an extra test option to disable
these particular messages is worth it. If you really want to disable them
during tests only you could unregister the `post_migrate` signals in your
test runner class setup with one that always pass a different `verbosity`.

--
Ticket URL: <https://code.djangoproject.com/ticket/30410#comment:1>

Reply all
Reply to author
Forward
0 new messages