Hi guys!
Hey, I was thinking about making a change in the way contexts work; Today, if we enter a role context, and change it, this change is maintained even after the context block is left. For example, the UserRole sets the default user as the user it creates via ensure_user(), which has impact into how other roles will function. What I'd like to do is, instead of keeping the change, just discard it after the script leaves the role context.
For example:
self.context['owner'] = 'foo'
with self.using(UserRole) as role:
role.ensure_user('bar')
assert self.context['owner'] == 'bar'
assert self.context['owner'] == 'foo'
What do you think? Does this make sense for you?
Cheers,