On Sun, Feb 1, 2009 at 7:42 PM, Jarkko Laiho <jarkko.la...@gmail.com> wrote:
>
>> The doc about defining a different test runner starts with the assumption
>> you are not using Django's test framework -- I read that to mean you are not
>> using django.test.TestCase tests, for example.  You can't just rip out the
>> database-create/destroy parts of the test runner and still expect to run
>> django.test.TestCase tests to still run, since they do assume a database
>> exists.
>
> OK, thanks for the info. I misinterpreted RKM's advice as saying that
> a database is not needed, whereas it now (having read your message)
> looks like he meant that a database is needed, but not necessarily
> through Django's ORM.

Sounds like some wires are getting crossed here.

Django's test framework contains several parts. There is the command
line hook that lets you invoke "manage.py test". There is a bunch of
global setup and teardown methods. There are some service mocks. There
is the test client that emulates a web browser. And there is the
Django TestCase class.

The Django TestCase requires the existence of a database, because it
exists to provide common database-centric testing services for Django
applications - in particular, setting up fixtures. If you're writing
tests that don't require the use of a database, you won't be able to
use the Django TestCase - but that's ok, because it wouldn't be giving
you anything interesting anyway. You can use standard Python
unittest.TestCase, though, and it will still be picked up by the
Django test runner.

There is nothing in the command line hook that requires the existence
of a database - other than the need to use a custom test runner like I
previously advised. With a custom, databaseless test running, you
should have no difficulty running tests inside the Django test
framework.

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-users@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
-~----------~----~----~----~------~----~------~--~---

Reply via email to