Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Changed setUp and tearDown for the tests converted from doctests in r…

…11695

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



git-svn-id: http://code.djangoproject.com/svn/django/trunk@11699 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit d4bb582b1a11edb28ab239fe1b7c6104d24a8e73 1 parent ff38e0b
Karen Tracey authored November 01, 2009

Showing 1 changed file with 5 additions and 2 deletions. Show diff stats Hide diff stats

  1. 7  tests/regressiontests/utils/dateformat.py
7  tests/regressiontests/utils/dateformat.py
@@ -6,11 +6,14 @@
6 6
 
7 7
 class DateFormatTests(TestCase):
8 8
     def setUp(self):
9  
-        self.old_TZ = os.environ['TZ']
  9
+        self.old_TZ = os.environ.get('TZ')
10 10
         os.environ['TZ'] = 'Europe/Copenhagen'
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_date(self):
16 19
         d = date(2009, 5, 16)

0 notes on commit d4bb582

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