[server] add test demonstrating cache update pb since cw > 3.21
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 16 Sep 2015 10:56:36 +0200
changeset 10998 5b646ab6821b
parent 10997 da712d3f0601
child 10999 adc46197b8c9
[server] add test demonstrating cache update pb since cw > 3.21 Fixed by the previous changeset.
server/test/unittest_repository.py
--- a/server/test/unittest_repository.py	Thu Dec 10 16:58:45 2015 +0100
+++ b/server/test/unittest_repository.py	Wed Sep 16 10:56:36 2015 +0200
@@ -339,6 +339,15 @@
                 self.assertEqual(cm.exception.errors, {'hip': 'hop'})
                 cnx.rollback()
 
+    def test_attribute_cache(self):
+        with self.admin_access.repo_cnx() as cnx:
+            bk = cnx.create_entity('Bookmark', title=u'index', path=u'/')
+            cnx.commit()
+            self.assertEqual(bk.title, 'index')
+            bk.cw_set(title=u'root')
+            self.assertEqual(bk.title, 'root')
+            cnx.commit()
+            self.assertEqual(bk.title, 'root')
 
 class SchemaDeserialTC(CubicWebTC):