[CMF-checkins] CVS: Products/CMFCalendar/tests - test_Calendar.py:1.4.22.8

Florent Guillaume fg at nuxeo.com
Tue Nov 16 12:36:08 EST 2004


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):
 



More information about the CMF-checkins mailing list