#21281: Make override_settings act at class level when used as a TestCase 
decorator
--------------------------------------+------------------------------------
     Reporter:  anonymous             |                    Owner:  nobody
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  Testing framework     |                  Version:  master
     Severity:  Release blocker       |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------
Changes (by timgraham):

 * status:  closed => new
 * has_patch:  1 => 0
 * resolution:  fixed =>
 * severity:  Normal => Release blocker
 * stage:  Ready for checkin => Accepted


Comment:

 I found a regression here that causes `override_settings()` to leak when
 used on a subclass test class. See
 `DateTimePickerShortcutsSeleniumFirefoxTests` in `admin_widgets` (we
 didn't notice it at the time because that's a selenium test which isn't
 run on Jenkins).

 Here's a simple test script which fails on the second test.
 {{{
 from unittest import TestCase
 from django.conf import settings
 from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase
 from django.test import override_settings

 @override_settings(TIME_ZONE='Asia/Singapore')
 class Test(AdminSeleniumWebDriverTestCase):
     def test(self):
         assert True

 class Test2(TestCase):
     def test(self):
         self.assertEqual(settings.TIME_ZONE, "America/Chicago")
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/21281#comment:9>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.920540139e9747b6d751df0c3d185001%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to