Ticket #16672: 16672.decorated-testcase-name.diff

File 16672.decorated-testcase-name.diff, 1.1 KB (added by julien, 4 years ago)
  • django/test/utils.py

    diff --git a/django/test/utils.py b/django/test/utils.py
    index 88da9d5..c0d9d41 100644
    a b class override_settings(object): 
    203203                def _post_teardown(innerself):
    204204                    super(inner, innerself)._post_teardown()
    205205                    self.disable()
     206            inner.__name__ = test_func.__name__
    206207        else:
    207208            @wraps(test_func)
    208209            def inner(*args, **kwargs):
  • tests/regressiontests/settings_tests/tests.py

    diff --git a/tests/regressiontests/settings_tests/tests.py b/tests/regressiontests/settings_tests/tests.py
    index 9715046..6af2ed3 100644
    a b class FullyDecoratedTranTestCase(TransactionTestCase): 
    1515    def test_method_override(self):
    1616        self.assertEqual(settings.TEST, 'override2')
    1717
     18    def test_decorated_testcase_name(self):
     19        self.assertEquals(FullyDecoratedTranTestCase.__name__, 'FullyDecoratedTranTestCase')
     20
    1821FullyDecoratedTranTestCase = override_settings(TEST='override')(FullyDecoratedTranTestCase)
    1922
    2023# @override_settings(TEST='override')
Back to Top