logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

CVS: Products/CMFCalendar/tests - test_Calendar.py:1.4.22.8: msg#00041

Subject: CVS: Products/CMFCalendar/tests - test_Calendar.py:1.4.22.8
Update of /cvs-repository/Products/CMFCalendar/tests
In directory cvs.zope.org:/tmp/cvs-serv25781

Modified Files:
      Tag: CMF-1_4-branch
        test_Calendar.py 
Log Message:
Fixed unit test assuming a C locale.
(Can be wrong when using test.py, which loads zope.conf)


=== Products/CMFCalendar/tests/test_Calendar.py 1.4.22.7 => 1.4.22.8 ===
--- Products/CMFCalendar/tests/test_Calendar.py:1.4.22.7        Sat Aug  7 
11:57:50 2004
+++ Products/CMFCalendar/tests/test_Calendar.py Tue Nov 16 12:36:07 2004
@@ -80,7 +80,13 @@
         self.assertEqual(self.Tool.getCalendarTypes(),['Event', 'Party'])
 
     def test_Days(self):
-        assert self.Tool.getDays() == ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 
'Sa']
+        import locale
+        old_locale = locale.getlocale(locale.LC_ALL)[0]
+        locale.setlocale(locale.LC_ALL, 'C')
+        try:
+            self.assertEqual(self.Tool.getDays(), ['Su', 'Mo', 'Tu', 'We', 
'Th', 'Fr', 'Sa'])
+        finally:
+            locale.setlocale(locale.LC_ALL, old_locale)
 
     def XXX_test_sessions(self):


<Prev in Thread] Current Thread [Next in Thread>