test/unittest_entity.py
changeset 9712 6c6cd8c4b256
parent 9638 3046bae3ce31
child 9770 112c884b2d8d
--- a/test/unittest_entity.py	Mon Apr 07 12:03:31 2014 +0200
+++ b/test/unittest_entity.py	Mon Apr 28 18:11:21 2014 +0200
@@ -371,6 +371,13 @@
             clear_cache(self.schema['EmailAddress'], 'get_rqlexprs')
             self.schema['EmailAddress'].permissions['read'] = rperms
 
+    def test_cw_linkable_rql(self):
+        with self.admin_access.web_request() as req:
+            email = req.execute('INSERT EmailAddress X: X address "hop"').get_entity(0, 0)
+            rql = email.cw_linkable_rql('use_email', 'CWUser', 'object')[0]
+            self.assertEqual(rql, 'Any S,AA,AB,AC,AD ORDERBY AA '
+                             'WHERE O eid %(x)s, S is_instance_of CWUser, '
+                             'S login AA, S firstname AB, S surname AC, S modification_date AD')
 
     def test_unrelated_rql_security_nonexistant(self):
         with self.new_access('anon').web_request() as req: