On Fri, Sep 12, 2008 at 7:35 AM, Denali Lumma <[EMAIL PROTECTED]> wrote: > > Hi There, > > I am trying to use the TestClient class to validate some of our > pages. It seems to work OK for pages which don't require > authentication.
It should work fine for pages _with_ authentication, too; you just need to authenticate the client first. > I am aware of the test database which is created and used in the > TestClient run, however, we have a special set up here. We are not > using any of Django's database support code. We have our own lower > level code which interacts with the database. You appear to be getting some terminology confused here. Are you talking about: * the TestClient - the dummy web browser * the Django Test Case - a wrapper around unittest.TestCase that provides a TestClient instance * the Django Test Runner - which creates the test database. The TestClient itself doesn't do anything with the database connection. It just hits the URLconf to activate the requested views and get the response. You should be able to run the TestClient without ever touching the database backend code. However, if you're talking about the test runner, the solution is easy - write a custom test runner. If you want to use an existing database rather than the Django Test database, take a copy of the runtests method in django.test.simple, remove the parts that create and destroy the test database, and refer to your modified version in the TEST_RUNNNER value of your settings file. See here for more details on the general process: http://docs.djangoproject.com/en/dev/topics/testing/#using-different-testing-frameworks 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 [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-users?hl=en -~----------~----~----~----~------~----~------~--~---

