cubicweb/server/test/unittest_querier.py
branch3.25
changeset 12228 8fa3131583ec
parent 12055 6672f51d8268
child 12248 6350e0a482d5
--- a/cubicweb/server/test/unittest_querier.py	Mon Oct 30 09:04:34 2017 +0100
+++ b/cubicweb/server/test/unittest_querier.py	Fri Nov 03 15:02:03 2017 +0100
@@ -1399,6 +1399,16 @@
             self.assertEqual(len(rset.rows), 1)
             self.assertEqual(rset.description, [('CWUser',)])
 
+    # computed relation tests ##################################################
+
+    def test_computed_relation_write_queries(self):
+        """Ensure we can use computed relation in WHERE clause of write queries"""
+        with self.admin_access.cnx() as cnx:
+            cnx.execute('INSERT Personne P: P nom "user", P login_user U WHERE NOT U user_login P')
+            cnx.execute('DELETE P login_user U WHERE U user_login P')
+            cnx.execute('DELETE Personne P WHERE U user_login P')
+            cnx.execute('SET U login "people" WHERE U user_login P')
+
     # ZT datetime tests ########################################################
 
     def test_tz_datetime(self):