1
0
mirror of https://github.com/django/django.git synced 2025-07-05 02:09:13 +00:00

[1.1.X] Repeat the setUp/tearDown changes made in r11699 for the tests

converted in r11694. This allows the dateformat tests to pass
on Windows. 


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@11702 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Karen Tracey 2009-11-01 23:52:31 +00:00
parent 13d83908a4
commit e114f4403a

View File

@ -5,12 +5,15 @@ import datetime, os, time
class DateFormatTests(TestCase): class DateFormatTests(TestCase):
def setUp(self): def setUp(self):
self.old_TZ = os.environ['TZ'] self.old_TZ = os.environ.get('TZ')
os.environ['TZ'] = 'Europe/Copenhagen' os.environ['TZ'] = 'Europe/Copenhagen'
translation.activate('en-us') translation.activate('en-us')
def tearDown(self): 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_empty_format(self): def test_empty_format(self):
my_birthday = datetime.datetime(1979, 7, 8, 22, 00) my_birthday = datetime.datetime(1979, 7, 8, 22, 00)
@ -80,4 +83,4 @@ class DateFormatTests(TestCase):
self.assertEquals(dateformat.format(wintertime, 'O'), u'+0100') self.assertEquals(dateformat.format(wintertime, 'O'), u'+0100')
except AttributeError: except AttributeError:
# No timezone available. Don't run the tests # No timezone available. Don't run the tests
pass pass