diff -r a76ac18f09c4 -r 872d16c04c79 server/test/unittest_postgres.py --- a/server/test/unittest_postgres.py Tue Jan 28 15:03:53 2014 +0100 +++ b/server/test/unittest_postgres.py Mon Jan 27 14:01:03 2014 +0100 @@ -16,27 +16,19 @@ # You should have received a copy of the GNU Lesser General Public License along # with CubicWeb. If not, see . -import socket from datetime import datetime from logilab.common.testlib import SkipTest -from cubicweb.devtools import ApptestConfiguration +from cubicweb.devtools import PostgresApptestConfiguration from cubicweb.devtools.testlib import CubicWebTC from cubicweb.predicates import is_instance from cubicweb.entities.adapters import IFTIndexableAdapter -AT_LOGILAB = socket.gethostname().endswith('.logilab.fr') # XXX - from unittest_querier import FixedOffset class PostgresFTITC(CubicWebTC): - @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) + configcls = PostgresApptestConfiguration def test_occurence_count(self): req = self.request() @@ -48,7 +40,7 @@ content=u'cubicweb cubicweb') self.commit() self.assertEqual(req.execute('Card X ORDERBY FTIRANK(X) DESC WHERE X has_text "cubicweb"').rows, - [(c1.eid,), (c3.eid,), (c2.eid,)]) + [[c1.eid,], [c3.eid,], [c2.eid,]]) def test_attr_weight(self): @@ -65,7 +57,7 @@ content=u'autre chose') self.commit() self.assertEqual(req.execute('Card X ORDERBY FTIRANK(X) DESC WHERE X has_text "cubicweb"').rows, - [(c3.eid,), (c1.eid,), (c2.eid,)]) + [[c3.eid,], [c1.eid,], [c2.eid,]]) def test_entity_weight(self): class PersonneIFTIndexableAdapter(IFTIndexableAdapter): @@ -78,7 +70,7 @@ c3 = req.create_entity('Comment', content=u'cubicweb cubicweb cubicweb', comments=c1) self.commit() self.assertEqual(req.execute('Any X ORDERBY FTIRANK(X) DESC WHERE X has_text "cubicweb"').rows, - [(c1.eid,), (c3.eid,), (c2.eid,)]) + [[c1.eid,], [c3.eid,], [c2.eid,]]) def test_tz_datetime(self):