On Sat, Jan 23, 2010 at 6:40 PM, Malcolm Box <malcolm....@gmail.com> wrote: > Hi, > > I've got an existing unit test suite using the django.test.TestCase class > that exercises the HTTP interface of the site, but running under Django's > test harness. > > I'd like to turn this into a black-box test suite, using real HTTP to talk > to the server remotely. Obviously some tests e.g. the assertTemplateUsed > test would be impossible, but most of my tests are of the form > client.put/client.get then assertContains/assertEquals. These should be > easy to transfer to an integration-level test suite. > > Has anyone tried doing something like this or know of existing code that can > do it?
It sounds like you've got a case of using the wrong shovel to nail in a screw. As the testing docs indicate, if you want to do live browser testing, you should use a live browser test tool like twill, Selenium or Windmill. Django's test client is a way to functionally invoke (and test) views as seen by Django. If you want a full integration level test suite, you should be looking at other tools. There is a long standing ticket (#2879) that proposes to improve the integration of these tools with Django. This ticket wasn't quite trunk ready last time I looked at it, but I'm still in favor of the general idea it is advocating. However, but even without fixing that ticket, it is possible to use them - it's just not as clean as it could be. Yours, Russ Magee %-) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.