Hi Florian, thanks for your reply.
I clearly didn't express myself properly, so let me try again with a simple example.
Suppose you are dealing with a detail view, whose context has an "object" key that refers to the object being displayed. Then, in the rendered template, you might have an inclusion tag that defines another context with an "object" key that refers to a different object (maybe one related to the "main" one). I don't see this as a bug, otherwise every tag should be aware of all the views (contexts and templates) where it is going to be used. Sure enough, if the tag takes the context, it is its responsibility to push and pop from the stack, but that's not what I was talking about.
The fact is that when the test client gets a page, for every template that gets rendered, the store_rendered_templates is called through a signal and the context appended to the ContextList. This list is then flattened when you try to get an item from one of the context, and if you have multiple context with the same key, the first one rendered will be the one that you get, given the current implementation of ContextList.__getitem__.
Hope that clears it up: ContextList is a list of dictionaries and I think it's not safe to assume that there are no overlapping keys - and probably it was already a knows "issue" since the keys method returns a set.
Let me know if I completely missed something else,
Germano