Opened 11 years ago

Closed 11 years ago

#21774 closed Bug (fixed)

Running some test labels individually results in PendingDeprecationWarnings

Reported by: Marc Tamlyn Owned by: nobody
Component: Uncategorized Version: dev
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 by Marc Tamlyn, 11 years ago

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

This takes the route of the better fix.

comment:2 by Marc Tamlyn <marc.tamlyn@…>, 11 years ago

Resolution: fixed
Status: newclosed

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