server/test/unittest_postgres.py
changeset 7228 9d04e12d2d39
parent 7211 cacff15f847d
child 8139 f9ebb6d1abc3
child 8343 6bd8db130476
--- a/server/test/unittest_postgres.py	Fri Apr 15 08:18:06 2011 +0200
+++ b/server/test/unittest_postgres.py	Fri Apr 15 08:18:59 2011 +0200
@@ -15,12 +15,12 @@
 from unittest_querier import FixedOffset
 
 class PostgresFTITC(CubicWebTC):
-    config = ApptestConfiguration('data', sourcefile='sources_postgres')
-
     @classmethod
     def setUpClass(cls):
         if not AT_LOGILAB: # XXX here until we can raise SkipTest in setUp to detect we can't connect to the db
             raise SkipTest('XXX %s: require logilab configuration' % cls.__name__)
+        cls.config = ApptestConfiguration('data', sourcefile='sources_postgres',
+                                          apphome=cls.datadir)
 
     def test_occurence_count(self):
         req = self.request()
@@ -71,7 +71,12 @@
         datenaiss = self.execute("Any XD WHERE X nom 'bob', X tzdatenaiss XD")[0][0]
         self.assertEqual(datenaiss.tzinfo, None)
         self.assertEqual(datenaiss.utctimetuple()[:5], (1977, 6, 7, 1, 0))
-
+        self.commit()
+        self.execute("INSERT Personne X: X nom 'boby', X tzdatenaiss %(date)s",
+                     {'date': datetime(1977, 6, 7, 2, 0)})
+        datenaiss = self.execute("Any XD WHERE X nom 'boby', X tzdatenaiss XD")[0][0]
+        self.assertEqual(datenaiss.tzinfo, None)
+        self.assertEqual(datenaiss.utctimetuple()[:5], (1977, 6, 7, 2, 0))
 
 if __name__ == '__main__':
     from logilab.common.testlib import unittest_main