server/test/unittest_multisources.py
changeset 5768 1e73a466aa69
parent 5655 ef903fff826d
child 6197 d8f0dce0b86d
equal deleted inserted replaced
5766:c397819f2482 5768:1e73a466aa69
   132 
   132 
   133     def test_has_text(self):
   133     def test_has_text(self):
   134         self.repo.sources_by_uri['extern'].synchronize(MTIME) # in case fti_update has been run before
   134         self.repo.sources_by_uri['extern'].synchronize(MTIME) # in case fti_update has been run before
   135         self.failUnless(self.sexecute('Any X WHERE X has_text "affref"'))
   135         self.failUnless(self.sexecute('Any X WHERE X has_text "affref"'))
   136         self.failUnless(self.sexecute('Affaire X WHERE X has_text "affref"'))
   136         self.failUnless(self.sexecute('Affaire X WHERE X has_text "affref"'))
       
   137         self.failUnless(self.sexecute('Any X ORDERBY FTIRANK(X) WHERE X has_text "affref"'))
       
   138         self.failUnless(self.sexecute('Affaire X ORDERBY FTIRANK(X) WHERE X has_text "affref"'))
   137 
   139 
   138     def test_anon_has_text(self):
   140     def test_anon_has_text(self):
   139         self.repo.sources_by_uri['extern'].synchronize(MTIME) # in case fti_update has been run before
   141         self.repo.sources_by_uri['extern'].synchronize(MTIME) # in case fti_update has been run before
   140         self.sexecute('INSERT Affaire X: X ref "no readable card"')[0][0]
   142         self.sexecute('INSERT Affaire X: X ref "no readable card"')[0][0]
   141         aff1 = self.sexecute('INSERT Affaire X: X ref "card"')[0][0]
   143         aff1 = self.sexecute('INSERT Affaire X: X ref "card"')[0][0]
   143         self.sexecute('SET X owned_by U WHERE X eid %(x)s, U login "anon"', {'x': aff1})
   145         self.sexecute('SET X owned_by U WHERE X eid %(x)s, U login "anon"', {'x': aff1})
   144         self.commit()
   146         self.commit()
   145         cnx = self.login('anon')
   147         cnx = self.login('anon')
   146         cu = cnx.cursor()
   148         cu = cnx.cursor()
   147         rset = cu.execute('Any X WHERE X has_text "card"')
   149         rset = cu.execute('Any X WHERE X has_text "card"')
       
   150         # 5: 4 card + 1 readable affaire
       
   151         self.assertEquals(len(rset), 5, zip(rset.rows, rset.description))
       
   152         rset = cu.execute('Any X ORDERBY FTIRANK(X) WHERE X has_text "card"')
   148         self.assertEquals(len(rset), 5, zip(rset.rows, rset.description))
   153         self.assertEquals(len(rset), 5, zip(rset.rows, rset.description))
   149         Connection_close(cnx)
   154         Connection_close(cnx)
   150 
   155 
   151     def test_synchronization(self):
   156     def test_synchronization(self):
   152         cu = cnx2.cursor()
   157         cu = cnx2.cursor()