[entity] explain why the assert failed stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 01 Apr 2010 08:24:11 +0200
branchstable
changeset 5127 3c2dda44e2f6
parent 5126 c869d8e7d166
child 5128 e5d300d75519
[entity] explain why the assert failed
entity.py
--- a/entity.py	Thu Apr 01 08:23:57 2010 +0200
+++ b/entity.py	Thu Apr 01 08:24:11 2010 +0200
@@ -882,7 +882,8 @@
     def set_attributes(self, **kwargs):
         _check_cw_unsafe(kwargs)
         assert kwargs
-        assert self._is_saved
+        assert self._is_saved, "should not call set_attributes while entity "\
+               "hasn't been saved yet"
         relations = []
         for key in kwargs:
             relations.append('X %s %%(%s)s' % (key, key))