On Wed, Aug 4, 2010 at 6:40 PM, Reinout van Rees <rein...@vanrees.org> wrote:
> Hi,
>
> http://docs.djangoproject.com/en/dev/topics/testing/#multi-database-support
> tells me to add "multi_db = True" to my unittest TestCase class to get multi
> db support.
>
> I'm using a doctest, however, and I can't figure out how to set that for my
> doctest.  Anyone know how to get that working?

There's no multi_db flag for doctests -- because you don't need one.

The multi_db=True flag on TestCase doesn't actually change anything in
the way the test operates; it's just telling the flushing
infrastructure which databases need to be flushed at the start of a
test.

Since flushing/rollback at the start of a test is an expensive
operation, it's time consuming to continuously flush all the databases
in your configuration. Therefore, Django will only flush the 'default'
database unless you specifically mark your test as a 'multi-db' test.
This way, you only flush the full database set if every database is
required in order to run the test.

Doctests don't do any database flushing, so there is no analog for the
multi-db flag. Just make your calls on the database as you normally
would.

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.

Reply via email to