Investigate possible misuse of Context
|Reported by:||Aymeric Augustin||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||yes|
This was reported in the comments of #17229, but I'm moving it to its own ticket for clarity.
Changeset r17894 produced several errors in the Django test suite. In fact, it reveals issues where Context instances are initialized with a Context argument instead of a simple dict.
- In browser:django/trunk/django/contrib/auth/tests/urls.py, several render_to_response calls have the Context instance as second argument, which seems to be plain bugs (uncaught until now)
- In browser:django/trunk/django/contrib/admin/templatetags/admin_modify.py, the prepopulated_fields_js inclusion tag returns a Context instance instead of a dict.
The question is now whether Context initialization should accept other Context instance as the
__init__ dict_ parameter (and then this changeset should be fixed) or if we should enforce dict_ as a dict and fix places in Django code when it is not the case. I'd be in favour of the latter, but this might need some more investigation.
Change History (7)
comment:1 Changed 5 years ago by
|Component:||Uncategorized → Template system|
|Type:||Uncategorized → Cleanup/optimization|