# HG changeset patch # User Sylvain Thénault # Date 1265353892 -3600 # Node ID 5c22869079b93bbda34e8e57094936b64d7e9c06 # Parent f628abfb3a6cba95a939df83d7e87520d8957615 clear rest_path __unique cache in clear_all_caches, fix related test diff -r f628abfb3a6c -r 5c22869079b9 entity.py --- a/entity.py Fri Feb 05 07:25:16 2010 +0100 +++ b/entity.py Fri Feb 05 08:11:32 2010 +0100 @@ -785,7 +785,12 @@ # clear relations cache for rschema, _, role in self.e_schema.relation_definitions(): self.clear_related_cache(rschema.type, role) - + # rest path unique cache + try: + del self.__unique + except AttributeError: + pass + # raw edition utilities ################################################### def set_attributes(self, _cw_unsafe=False, **kwargs): diff -r f628abfb3a6c -r 5c22869079b9 test/unittest_entity.py --- a/test/unittest_entity.py Fri Feb 05 07:25:16 2010 +0100 +++ b/test/unittest_entity.py Fri Feb 05 08:11:32 2010 +0100 @@ -458,6 +458,7 @@ self.assertEquals(person.rest_path(), 'personne/doe') # ambiguity test person2 = req.create_entity('Personne', prenom=u'remi', nom=u'doe') + person.clear_all_caches() self.assertEquals(person.rest_path(), 'personne/eid/%s' % person.eid) self.assertEquals(person2.rest_path(), 'personne/eid/%s' % person2.eid) # unique attr with None value (wikiid in this case)