cubicweb/test/unittest_rset.py
changeset 11169 c1eb5a676c80
parent 11057 0b59724cb3f2
child 11171 b81e543e623a
--- a/cubicweb/test/unittest_rset.py	Tue Jan 12 17:36:28 2016 +0100
+++ b/cubicweb/test/unittest_rset.py	Tue Jan 12 14:31:14 2016 +0100
@@ -307,6 +307,11 @@
             self.assertEqual(e.cw_col, 0)
             self.assertEqual(e.cw_attr_cache['title'], 'zou')
             self.assertRaises(KeyError, e.cw_attr_cache.__getitem__, 'path')
+            other_rset = req.execute('Any X, P WHERE X is Bookmark, X path P')
+            # check that get_entity fetches e from the request's cache, and
+            # updates it with attributes from the new rset
+            self.assertIs(other_rset.get_entity(0, 0), e)
+            self.assertIn('path', e.cw_attr_cache)
             self.assertEqual(e.view('text'), 'zou')
             self.assertEqual(pprelcachedict(e._cw_related_cache), [])