#15826: TestCase assertions should work with TemplateResponse
----------------------+----------------------------------
Reporter: bmihelac | Owner: nobody
Type: Bug | Status: new
Milestone: | Component: Testing framework
Version: 1.3 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 |
----------------------+----------------------------------
When using assertContains for testing class based generic views or other
views that returns TemplateResponse, following error is raised:
{{{
ContentNotRenderedError: The response content must be rendered before it
can be accessed.
}}}
Example:
{{{
response = SomeView.as_view()(request)
self.assertContains(response, 'some content')
}}}
This can be avoided with adding response.render() before assertion is
called, but in my opinion assertContain should check if content is
rendered instead.
--
Ticket URL: <http://code.djangoproject.com/ticket/15826>
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.