cubicweb/server/test/unittest_querier.py
branch3.25
changeset 12228 8fa3131583ec
parent 12055 6672f51d8268
child 12248 6350e0a482d5
equal deleted inserted replaced
12217:6ab1793f6f83 12228:8fa3131583ec
  1397             rset = cnx.execute("Any X WHERE X is CWUser, X login 'bob', X upassword %(pwd)s",
  1397             rset = cnx.execute("Any X WHERE X is CWUser, X login 'bob', X upassword %(pwd)s",
  1398                                {'pwd': Binary(passwd)})
  1398                                {'pwd': Binary(passwd)})
  1399             self.assertEqual(len(rset.rows), 1)
  1399             self.assertEqual(len(rset.rows), 1)
  1400             self.assertEqual(rset.description, [('CWUser',)])
  1400             self.assertEqual(rset.description, [('CWUser',)])
  1401 
  1401 
       
  1402     # computed relation tests ##################################################
       
  1403 
       
  1404     def test_computed_relation_write_queries(self):
       
  1405         """Ensure we can use computed relation in WHERE clause of write queries"""
       
  1406         with self.admin_access.cnx() as cnx:
       
  1407             cnx.execute('INSERT Personne P: P nom "user", P login_user U WHERE NOT U user_login P')
       
  1408             cnx.execute('DELETE P login_user U WHERE U user_login P')
       
  1409             cnx.execute('DELETE Personne P WHERE U user_login P')
       
  1410             cnx.execute('SET U login "people" WHERE U user_login P')
       
  1411 
  1402     # ZT datetime tests ########################################################
  1412     # ZT datetime tests ########################################################
  1403 
  1413 
  1404     def test_tz_datetime(self):
  1414     def test_tz_datetime(self):
  1405         self.qexecute("INSERT Personne X: X nom 'bob', X tzdatenaiss %(date)s",
  1415         self.qexecute("INSERT Personne X: X nom 'bob', X tzdatenaiss %(date)s",
  1406                      {'date': datetime(1977, 6, 7, 2, 0, tzinfo=FixedOffset(1))})
  1416                      {'date': datetime(1977, 6, 7, 2, 0, tzinfo=FixedOffset(1))})