1402 rset = cnx.execute("Any X WHERE X is CWUser, X login 'bob', X upassword %(pwd)s", |
1402 rset = cnx.execute("Any X WHERE X is CWUser, X login 'bob', X upassword %(pwd)s", |
1403 {'pwd': Binary(passwd)}) |
1403 {'pwd': Binary(passwd)}) |
1404 self.assertEqual(len(rset.rows), 1) |
1404 self.assertEqual(len(rset.rows), 1) |
1405 self.assertEqual(rset.description, [('CWUser',)]) |
1405 self.assertEqual(rset.description, [('CWUser',)]) |
1406 |
1406 |
|
1407 # computed relation tests ################################################## |
|
1408 |
|
1409 def test_computed_relation_write_queries(self): |
|
1410 """Ensure we can use computed relation in WHERE clause of write queries""" |
|
1411 with self.admin_access.cnx() as cnx: |
|
1412 cnx.execute('INSERT Personne P: P nom "user", P login_user U WHERE NOT U user_login P') |
|
1413 cnx.execute('DELETE P login_user U WHERE U user_login P') |
|
1414 cnx.execute('DELETE Personne P WHERE U user_login P') |
|
1415 cnx.execute('SET U login "people" WHERE U user_login P') |
|
1416 |
1407 # ZT datetime tests ######################################################## |
1417 # ZT datetime tests ######################################################## |
1408 |
1418 |
1409 def test_tz_datetime(self): |
1419 def test_tz_datetime(self): |
1410 self.qexecute("INSERT Personne X: X nom 'bob', X tzdatenaiss %(date)s", |
1420 self.qexecute("INSERT Personne X: X nom 'bob', X tzdatenaiss %(date)s", |
1411 {'date': datetime(1977, 6, 7, 2, 0, tzinfo=FixedOffset(1))}) |
1421 {'date': datetime(1977, 6, 7, 2, 0, tzinfo=FixedOffset(1))}) |