Hi all,

Long-time user; first time attempting to contribute :-)

I'm a huge testing nut and there are some short cut/helper functions
we use at work that I'd like to clean up and contribute if folks are
interested.

The first is a simple method on TestCase that makes checking a normal
view pretty dirty simple... here's the signature:
check_response(self, response, template_name=None, text_checks=[],
content_type="text/html")

It dovetails really well with the additional methods y'all added to
the TestCase object post 0.96 (we're on 0.96 at work until I or one of
my devs get the time to maintain a custom patched version...).

A hypothetical developer does any setup they need to do, calls their
view with the test client and then passes the response, an optional
template_name, some text that should appear in the  rendered template
(and counts on each string), and a content type. This one function
does all the checking for you.

It's not rocket science, it just takes a 2 or 3 line self.assertX,
self.assertY call and makes it a one-liner. I like DRY and I like
testing, so this seemed to be a good fit.

If folks are interested I can supply a diff/patch on test case as well
as tests for the assertion/check_response methods. Should I supply
that in a ticket?

Thanks!

Chris H.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" 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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to