summaryrefslogtreecommitdiff
path: root/tests/regressiontests/dateformat/tests.py
diff options
context:
space:
mode:
authorKaren Tracey <kmtracey@gmail.com>2009-11-01 23:48:31 +0000
committerKaren Tracey <kmtracey@gmail.com>2009-11-01 23:48:31 +0000
commit1ea08b441d5517573aee6547a06b7d64e7a0d8b3 (patch)
tree19dbac03a0a5370d232794f9a0c96b3282dfc83f /tests/regressiontests/dateformat/tests.py
parentd4bb582b1a11edb28ab239fe1b7c6104d24a8e73 (diff)
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/trunk@11701 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/dateformat/tests.py')
-rw-r--r--tests/regressiontests/dateformat/tests.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/regressiontests/dateformat/tests.py b/tests/regressiontests/dateformat/tests.py
index 93418d2f63..3a19d26e19 100644
--- a/tests/regressiontests/dateformat/tests.py
+++ b/tests/regressiontests/dateformat/tests.py
@@ -5,12 +5,15 @@ import datetime, os, time
class DateFormatTests(TestCase):
def setUp(self):
- self.old_TZ = os.environ['TZ']
+ self.old_TZ = os.environ.get('TZ')
os.environ['TZ'] = 'Europe/Copenhagen'
translation.activate('en-us')
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):
my_birthday = datetime.datetime(1979, 7, 8, 22, 00)
@@ -80,4 +83,4 @@ class DateFormatTests(TestCase):
self.assertEquals(dateformat.format(wintertime, 'O'), u'+0100')
except AttributeError:
# No timezone available. Don't run the tests
- pass \ No newline at end of file
+ pass