web/test/unittest_widgets.py
branchtls-sprint
changeset 1016 26387b836099
parent 807 e3cabbdd172a
child 1398 5fe84a5f7035
--- a/web/test/unittest_widgets.py	Mon Mar 09 12:12:53 2009 +0100
+++ b/web/test/unittest_widgets.py	Tue Mar 10 11:35:52 2009 +0100
@@ -2,8 +2,9 @@
 
 """
 
-from mx.DateTime import now
-NOW = now()
+from datetime import datetime
+NOW = datetime.now()
+
 from logilab.common.testlib import unittest_main
 from cubicweb.devtools.apptest import EnvBasedTC
 
@@ -186,10 +187,9 @@
     def test_datetime_widget(self):
         w = self.get_widget('Personne', 'datenaiss', 'Datetime')
         self.assertEquals(w.name, 'datenaiss')
-        now_ = now()
         example = '%s, or without time: %s' % (        
-            now_.strftime(self.vreg.property_value('ui.datetime-format')),
-            now_.strftime(self.vreg.property_value('ui.date-format')))
+            NOW.strftime(self.vreg.property_value('ui.datetime-format')),
+            NOW.strftime(self.vreg.property_value('ui.date-format')))
         self.assertEquals(w.render_example(self.request()), example)
         self.assertDictEquals(w.attrs, {'accesskey': 'd', 'maxlength': 16, 'size': 16})
         entity = self.etype_instance('Personne')