Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[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
  • Loading branch information...
commit e114f4403a2e0f49de10cb8bd2fde90f4693c2c1 1 parent 13d8390
Karen Tracey authored November 01, 2009

Showing 1 changed file with 6 additions and 3 deletions. Show diff stats Hide diff stats

  1. 9  tests/regressiontests/dateformat/tests.py
9  tests/regressiontests/dateformat/tests.py
@@ -5,12 +5,15 @@
5 5
 
6 6
 class DateFormatTests(TestCase):
7 7
     def setUp(self):
8  
-        self.old_TZ = os.environ['TZ']
  8
+        self.old_TZ = os.environ.get('TZ')
9 9
         os.environ['TZ'] = 'Europe/Copenhagen'
10 10
         translation.activate('en-us')
11 11
 
12 12
     def tearDown(self):
13  
-        os.environ['TZ'] = self.old_TZ
  13
+        if self.old_TZ is None:
  14
+            del os.environ['TZ']
  15
+        else:
  16
+            os.environ['TZ'] = self.old_TZ
14 17
 
15 18
     def test_empty_format(self):
16 19
         my_birthday = datetime.datetime(1979, 7, 8, 22, 00)
@@ -80,4 +83,4 @@ def test_timezones(self):
80 83
             self.assertEquals(dateformat.format(wintertime, 'O'), u'+0100')
81 84
         except AttributeError:
82 85
             # No timezone available. Don't run the tests
83  
-            pass
  86
+            pass

0 notes on commit e114f44

Please sign in to comment.
Something went wrong with that request. Please try again.