Re: [Django] #15826: TestCase assertions should work with TemplateResponse

2011-10-22 Thread Django
#15826: TestCase assertions should work with TemplateResponse
---+-
 Reporter:  bmihelac   |Owner:  mmcnickle
 Type:  Bug|   Status:  closed
Component:  Testing framework  |  Version:  1.3
 Severity:  Normal |   Resolution:  fixed
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |
---+-
Changes (by julien):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [17025]:
 {{{
 #!CommitTicketReference repository="" revision="17025"
 Fixed #15826 -- Made `assertContains` and `assertNotContains` work with
 `SimpleTemplateResponse` by forcing it to be rendered if it hasn't been
 rendered yet. Thanks to bmihelac for the report, to mmcnickle for the
 initial patch and tests, and to Carl Meyer for the guidance.
 }}}

-- 
Ticket URL: 
Django 
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.



Re: [Django] #15826: TestCase assertions should work with TemplateResponse

2011-05-21 Thread Django
#15826: TestCase assertions should work with TemplateResponse
+---
   Reporter:  bmihelac  |  Owner:  mmcnickle
   Type:  Bug   | Status:  assigned
  Milestone:|  Component:  Testing framework
Version:  1.3   |   Severity:  Normal
 Resolution:|   Keywords:
   Triage Stage:  Accepted  |  Has patch:  1
Needs documentation:  0 |Needs tests:  0
Patch needs improvement:  0 |  Easy pickings:  0
+---

Comment (by carljm):

 Replying to [comment:3 mmcnickle]:
 > I do an explicit check for instanceof(response, SimpleTemplateResponse),
 but perhaps duck typing for any response with response.render() would be
 more appropriate/useful?

 Yes, I think it'd be better to check for a callable response.render()
 rather than using isinstance. This (checking for the render method) is
 what Django already does in its normal response handling, after template
 response middleware.

-- 
Ticket URL: 
Django 
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.



Re: [Django] #15826: TestCase assertions should work with TemplateResponse

2011-05-21 Thread Django
#15826: TestCase assertions should work with TemplateResponse
+---
   Reporter:  bmihelac  |  Owner:  mmcnickle
   Type:  Bug   | Status:  assigned
  Milestone:|  Component:  Testing framework
Version:  1.3   |   Severity:  Normal
 Resolution:|   Keywords:
   Triage Stage:  Accepted  |  Has patch:  1
Needs documentation:  0 |Needs tests:  0
Patch needs improvement:  0 |  Easy pickings:  0
+---

Comment (by mmcnickle):

 I added a check if the response handed to assertContains is a
 TemplateResponse, and if so, will render it.
 Added the same check to assertNotContains for consistency.

 I do an explicit check for instanceof(response, SimpleTemplateResponse),
 but perhaps duck typing for any response with response.render() would be
 more appropriate/useful?

-- 
Ticket URL: 
Django 
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.



Re: [Django] #15826: TestCase assertions should work with TemplateResponse

2011-05-21 Thread Django
#15826: TestCase assertions should work with TemplateResponse
+---
   Reporter:  bmihelac  |  Owner:  mmcnickle
   Type:  Bug   | Status:  assigned
  Milestone:|  Component:  Testing framework
Version:  1.3   |   Severity:  Normal
 Resolution:|   Keywords:
   Triage Stage:  Accepted  |  Has patch:  1
Needs documentation:  0 |Needs tests:  0
Patch needs improvement:  0 |  Easy pickings:  0
+---
Changes (by mmcnickle):

 * owner:  nobody => mmcnickle
 * cc: mmcnickle (added)
 * has_patch:  0 => 1
 * status:  new => assigned


-- 
Ticket URL: 
Django 
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.



Re: [Django] #15826: TestCase assertions should work with TemplateResponse

2011-04-21 Thread Django
#15826: TestCase assertions should work with TemplateResponse
+---
   Reporter:  bmihelac  |  Owner:  nobody
   Type:  Bug   | Status:  new
  Milestone:|  Component:  Testing framework
Version:  1.3   |   Severity:  Normal
 Resolution:|   Keywords:
   Triage Stage:  Accepted  |  Has patch:  0
Needs documentation:  0 |Needs tests:  0
Patch needs improvement:  0 |  Easy pickings:  0
+---
Changes (by carljm):

 * needs_better_patch:   => 0
 * stage:  Unreviewed => Accepted
 * easy:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


-- 
Ticket URL: 
Django 
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.



[Django] #15826: TestCase assertions should work with TemplateResponse

2011-04-14 Thread Django
#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: 
Django 
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.