server/test/unittest_ldapuser.py
changeset 1122 9f37de24251f
parent 975 0928daea04e9
child 1398 5fe84a5f7035
equal deleted inserted replaced
1121:43fa67acd9d0 1122:9f37de24251f
   277         rset = cu.execute('Any F WHERE X has_text "syt", X firstname F')
   277         rset = cu.execute('Any F WHERE X has_text "syt", X firstname F')
   278         self.assertEquals(rset.rows, [])
   278         self.assertEquals(rset.rows, [])
   279         rset = cu.execute('Any F WHERE X has_text "iaminguestsgrouponly", X firstname F')
   279         rset = cu.execute('Any F WHERE X has_text "iaminguestsgrouponly", X firstname F')
   280         self.assertEquals(rset.rows, [[None]])
   280         self.assertEquals(rset.rows, [[None]])
   281 
   281 
   282     def test_nonregr_1(self):
   282     def test_nonregr1(self):
   283         self.execute('Any X,AA ORDERBY AA DESC WHERE E eid %(x)s, E owned_by X, '
   283         self.execute('Any X,AA ORDERBY AA DESC WHERE E eid %(x)s, E owned_by X, '
   284                      'X modification_date AA',
   284                      'X modification_date AA',
   285                      {'x': cnx.user(self.session).eid})
   285                      {'x': cnx.user(self.session).eid})
   286 
   286 
   287     def test_nonregr_2(self):
   287     def test_nonregr2(self):
   288         self.execute('Any X,L,AA WHERE E eid %(x)s, E owned_by X, '
   288         self.execute('Any X,L,AA WHERE E eid %(x)s, E owned_by X, '
   289                      'X login L, X modification_date AA',
   289                      'X login L, X modification_date AA',
   290                      {'x': cnx.user(self.session).eid})
   290                      {'x': cnx.user(self.session).eid})
   291 
   291 
   292     def test_nonregr_3(self):
   292     def test_nonregr3(self):
   293         self.execute('Any X,AA ORDERBY AA DESC WHERE E eid %(x)s, '
   293         self.execute('Any X,AA ORDERBY AA DESC WHERE E eid %(x)s, '
   294                      'X modification_date AA',
   294                      'X modification_date AA',
   295                      {'x': cnx.user(self.session).eid})
   295                      {'x': cnx.user(self.session).eid})
   296 
   296 
   297     def test_nonregr_4(self):
   297     def test_nonregr4(self):
   298         emaileid = self.execute('INSERT EmailAddress X: X address "toto@logilab.org"')[0][0]
   298         emaileid = self.execute('INSERT EmailAddress X: X address "toto@logilab.org"')[0][0]
   299         self.execute('Any X,AA WHERE X use_email Y, Y eid %(x)s, X modification_date AA',
   299         self.execute('Any X,AA WHERE X use_email Y, Y eid %(x)s, X modification_date AA',
   300                      {'x': emaileid})
   300                      {'x': emaileid})
   301         
   301         
   302     def test_nonregr_5(self):
   302     def test_nonregr5(self):
   303         # original jpl query:
   303         # original jpl query:
   304         # Any X, NOW - CD, P WHERE P is Project, U interested_in P, U is EUser, U login "sthenault", X concerns P, X creation_date CD ORDERBY CD DESC LIMIT 5
   304         # Any X, NOW - CD, P WHERE P is Project, U interested_in P, U is EUser, U login "sthenault", X concerns P, X creation_date CD ORDERBY CD DESC LIMIT 5
   305         rql = 'Any X, NOW - CD, P ORDERBY CD DESC LIMIT 5 WHERE P bookmarked_by U, U login "%s", P is X, X creation_date CD' % self.session.user.login
   305         rql = 'Any X, NOW - CD, P ORDERBY CD DESC LIMIT 5 WHERE P bookmarked_by U, U login "%s", P is X, X creation_date CD' % self.session.user.login
   306         self.execute(rql, )#{'x': })
   306         self.execute(rql, )#{'x': })
   307         
   307         
       
   308     def test_nonregr6(self):
       
   309         self.execute('Any B,U,UL GROUPBY B,U,UL WHERE B created_by U?, B is File '
       
   310                      'WITH U,UL BEING (Any U,UL WHERE ME eid %(x)s, (EXISTS(U identity ME) '
       
   311                      'OR (EXISTS(U in_group G, G name IN("managers", "staff")))) '
       
   312                      'OR (EXISTS(U in_group H, ME in_group H, NOT H name "users")), U login UL, U is EUser)',
       
   313                      {'x': self.session.user.eid})
       
   314 
   308 
   315 
   309 class GlobTrFuncTC(TestCase):
   316 class GlobTrFuncTC(TestCase):
   310 
   317 
   311     def test_count(self):
   318     def test_count(self):
   312         trfunc = GlobTrFunc('count', 0)
   319         trfunc = GlobTrFunc('count', 0)