tangentlabs/django-oscar — pull request #250 by elbaschid (2012-07-26 02:57:21+00:00)
Title: updated render_promotion template tag to provide copy of global context

I had an issue with the promotions automatically generating a list of products with the ability to add them to the basket. As the template tag ``render_promotion`` creates an empty ``RequestContext`` the basket instance is not available in the promotion's context.

After talking to @a-musing-moose, I thought it would be best to add the current (global) context to the promotion. I updated the template tag accordingly. It now creates a copy of the global context to prevent it from being cluttered with promotion specific variables. The promotion's context is then used to update this context copy. I also added some unit tests.

I am not sure if this is the way the ``render_promotion`` tag should work but I assume that the basket is pretty likely to be used in a promotion that lists/shows products. Please let me know if you reject this change so I can put it into our project.

Also, any feedback on doing it differently or better would be appreciated.