Commit 3d941756 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

clear rest_path __unique cache in clear_all_caches, fix related test

parent f628abfb3a6c
......@@ -785,7 +785,12 @@ class Entity(AppObject, dict):
# 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):
......
......@@ -458,6 +458,7 @@ du :eid:`1:*ReST*`'''
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)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment