#21774 closed Bug (fixed)

Running some test labels individually results in PendingDeprecationWarnings

Reported by: mjtamlyn Owned by: nobody
Component: Uncategorized Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Try python -Wall runtests.py file_uploads

This seems to be because tests/urls.py includes urls from admin_widgets which has models imported, which are not installed.

The easy fix would be to ensure every model in admin_widgets and file_uploads specifies an app_label. The better fix would be to get rid of the global tests.urls file in favour of TestCase.urls, at least for these two app labels.

Change History (2)

comment:1 Changed 19 months ago by mjtamlyn

PR: https://github.com/django/django/pull/2166

This takes the route of the better fix.

comment:2 Changed 19 months ago by Marc Tamlyn <marc.tamlyn@…>

  • Resolution set to fixed
  • Status changed from new to closed

In 2607fa901699916c4825f145fa8a84f49b8524ff:

Fixed #21774 -- Isolate all test urls from eachother.

This (nearly) completes the work to isolate all the test modules from
each other. This is now more important as importing models from another
module will case PendingDeprecationWarnings if those modules are not in
INSTALLED_APPS. The only remaining obvious dependencies are:

  • d.c.auth depends on d.c.admin (because of the is_admin flag to some views), but this is not so important and d.c.admin is in always_installed_apps
  • test_client_regress depends on test_client. Eventually these should become a single module, as the split serves no useful purpose.
Note: See TracTickets for help on using tickets.
Back to Top