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 %-)