Permalink
Browse files

[1.1.X] Changed setUp and tearDown for the tests converted from docte…

…sts in r11695

to not assume TZ absolutely will be set in the environment. That environment
variable does not necessarily exist on Windows, it seems. 

r11699 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@11700 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 8061665 commit 13d83908a4fa15570c265d310f2ecc4295bd7411 @kmtracey kmtracey committed Nov 1, 2009
Showing with 5 additions and 2 deletions.
  1. +5 −2 tests/regressiontests/utils/dateformat.py
@@ -6,11 +6,14 @@
class DateFormatTests(TestCase):
def setUp(self):
- self.old_TZ = os.environ['TZ']
+ self.old_TZ = os.environ.get('TZ')
os.environ['TZ'] = 'Europe/Copenhagen'
def tearDown(self):
- os.environ['TZ'] = self.old_TZ
+ if self.old_TZ is None:
+ del os.environ['TZ']
+ else:
+ os.environ['TZ'] = self.old_TZ
def test_date(self):
d = date(2009, 5, 16)

0 comments on commit 13d8390

Please sign in to comment.