future of @skipIfCustomUser decorator? (#22993)

77 views
Skip to first unread message

Tim Graham

unread,
Jul 11, 2014, 1:06:45 PM7/11/14
to django-d...@googlegroups.com
With the test discovery changes in 1.6, the tests for django.contrib apps are no longer run as part of a user's project. For this reason I believe we no longer need to decorate tests in contrib.auth, formtools, and flatpages with @skipIfCustomUser. Is that correct? If so, should we keep the decorator at all? It is documented, but it's not clear to me if the test runner changes were meant to discourage writing these sort of "integration" tests or not.

Russell Keith-Magee

unread,
Jul 11, 2014, 8:07:25 PM7/11/14
to Django Developers
On Sat, Jul 12, 2014 at 1:06 AM, Tim Graham <timog...@gmail.com> wrote:
With the test discovery changes in 1.6, the tests for django.contrib apps are no longer run as part of a user's project. For this reason I believe we no longer need to decorate tests in contrib.auth, formtools, and flatpages with @skipIfCustomUser. Is that correct? If so, should we keep the decorator at all? It is documented, but it's not clear to me if the test runner changes were meant to discourage writing these sort of "integration" tests or not.

I can see one reason to keep the decorator -- both in Django's test suite, and as a general utility: Projects that are intending to keep their test suites on the "old" discovery mechanism. 

My own codebase is 4 years old, and has a large test suite; I've dutifully upgraded every Django version (with very little effort, I might add), but re-engineering the entire test suite is probably not something I'm going to do (at least, not until I've got spare time... hahahahahaha :-) So, I'm probably going to package or vendor out the old runner so that my test suite will keep running.

@skipIfCustomUser may not have a use in Django's own test suite, but I can see it being useful for a while for projects that are migrating (slowly) away from the old test runner.

Russ %-)

Michael Manfre

unread,
Jul 11, 2014, 8:27:22 PM7/11/14
to django-d...@googlegroups.com
On Fri, Jul 11, 2014 at 8:07 PM, Russell Keith-Magee <rus...@keith-magee.com> wrote:
@skipIfCustomUser may not have a use in Django's own test suite, but I can see it being useful for a while for projects that are migrating (slowly) away from the old test runner.

This is also used by 3rd party apps that support multiple versions of Django with a single code base.

Regards,
Michael Manfre

Tim Graham

unread,
Jul 12, 2014, 10:47:17 AM7/12/14
to django-d...@googlegroups.com
Okay, the only real maintenance burden I'm concerned about is figuring out if new tests in Django's test suite need to use the decorator or not. Maybe we could consider dropping that requirement by Django 2.0 or so.
Reply all
Reply to author
Forward
0 new messages