canonical-django team mailing list archive
-
canonical-django team
-
Mailing list archive
-
Message #00025
Re: Django testing best practices
Hi James,
On Mon, Jun 14, 2010 at 1:15 PM, James Westby
<james.westby@xxxxxxxxxxxxx> wrote:
> On Mon, 14 Jun 2010 12:46:05 +0200, Jamu Kakar <jamshed.kakar@xxxxxxxxxxxxx> wrote:
>> - With PostgreSQL at least, the cost of dropping and recreating
>> tables is higher than deleting all the data in every table, when
>> you have a small amount of data. We've found that DELETE FROM is
>> faster than TRUNCATE in these cases, too.
>
> Django by default doesn't commit, so I assume that works better until
> you have a need to commit in the tests?
Well, regardless of whether or not Django commits, you want to make
sure each test starts with the database in a known state, right? We
make sure to flush our stores at the end of a test, to make sure
that SQL statements get to the database to exercise database
constraints.
> I have a related issue of managing things like settings.py in multiple
> branches.
Doesn't Bazaar just do the right thing, or am I missing something
here?
Thanks,
J.
Follow ups
References