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

Florent Guillaume fg at nuxeo.com
Tue Nov 16 12:58:11 EST 2004


Update of /cvs-repository/Products/CMFCalendar/tests
In directory cvs.zope.org:/tmp/cvs-serv31073

Modified Files:
	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.12 => 1.13 ===
--- Products/CMFCalendar/tests/test_Calendar.py:1.12	Thu Aug 12 11:07:38 2004
+++ Products/CMFCalendar/tests/test_Calendar.py	Tue Nov 16 12:58:11 2004
@@ -101,7 +101,13 @@
         self.assertEqual(self.Tool.getCalendarStates(), ('pending', 'published'))
 
     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