Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#16672 closed Bug (fixed)

Preserve name of TestCase decorated with override_settings

Reported by: Julien Phalip Owned by: nobody
Component: Testing framework Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Currently the decorated TestCase gets the name of 'inner'. See patch attached.

Attachments (1)

16672.decorated-testcase-name.diff (1.1 KB ) - added by Julien Phalip 13 years ago.

Download all attachments as: .zip

Change History (6)

by Julien Phalip, 13 years ago

comment:1 by Julien Phalip, 13 years ago

Perhaps other attributes should be preserved, but in my use case __name__ is all I need.

comment:2 by Aymeric Augustin, 13 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Jannis Leidel, 13 years ago

Triage Stage: AcceptedReady for checkin

comment:4 by Russell Keith-Magee, 13 years ago

Resolution: fixed
Status: newclosed

In [16650]:

Fixed #16672 -- Ensure that test classes decorated with @override_setings gets the right name when running the tests. Thanks to Julien Phalip for the report and initial patch

comment:5 by Ramiro Morales, 13 years ago

In [16722]:

Also copy __module__ to our dynamically created TestCase subclass when override_settings acts as a class decorator.

Otherwise, an error in e.g. a test in tests/modeltests/proxy_model_inheritance/tests.py
was being reported as:

ERROR: test_table_exists (django.test.utils.ProxyModelInheritanceTests)

Refs #16672 and [16650].

Note: See TracTickets for help on using tickets.
Back to Top