#12089: test client fails to collect sub-contexts
----------------------------------------+-----------------------------------
          Reporter:  akaihola           |         Owner:  nobody
            Status:  new                |     Milestone:        
         Component:  Testing framework  |       Version:  SVN   
        Resolution:                     |      Keywords:        
             Stage:  Unreviewed         |     Has_patch:  1     
        Needs_docs:  0                  |   Needs_tests:  0     
Needs_better_patch:  0                  |  
----------------------------------------+-----------------------------------
Changes (by akaihola):

  * needs_better_patch:  1 => 0

Comment:

 One thing to note in the v2 patch is that it assumes that all items of
 `context.dicts` have the `copy()` method. Normally they do as they are
 `dict`s.

 In one of my projects I was erroneously calling
 {{{
 render_to_string('template.html', Context({...}))
 }}}
 while the second argument is expected to be a plain dict. This works
 because a `Context` object behaves similarly enough to a dict, but the
 patched test client crashed since `Context` has no `copy()` method.

 One could maybe imagine valid reasons to build a context out of
 `dict`-like objects which aren't real `dict`s and might lack a
 `copy()` method.  Should the test client use more bare-bones `dict`
 methods to make copies of the context to make sure this is as
 backwards compatible as possible?

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12089#comment:4>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to