cubicweb/server/test/unittest_querier.py
changeset 12248 6350e0a482d5
parent 12242 68ca7fe0ca29
parent 12228 8fa3131583ec
child 12539 10159a3d1d72
--- a/cubicweb/server/test/unittest_querier.py	Tue Dec 12 11:17:25 2017 +0100
+++ b/cubicweb/server/test/unittest_querier.py	Fri Jan 12 11:02:52 2018 +0100
@@ -1404,6 +1404,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):