Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit 1ea08b441d5517573aee6547a06b7d64e7a0d8b3 1 parent d4bb582
Karen Tracey kmtracey authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 tests/regressiontests/dateformat/tests.py
9 tests/regressiontests/dateformat/tests.py
View
@@ -5,12 +5,15 @@
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 @@ def test_timezones(self):
self.assertEquals(dateformat.format(wintertime, 'O'), u'+0100')
except AttributeError:
# No timezone available. Don't run the tests
- pass
+ pass
Please sign in to comment.
Something went wrong with that request. Please try again.