Re: Database weirdness in test harness

2008-06-23 Thread Luke Plant
On Monday 23 June 2008 14:03:48 Michael Glassford wrote: > Enough excuses. I'm usually more careful about looking closely at > something before replying, and I'll try to be next time. I'm also > looking at modifying Model._collect_sub_objects (to handle other > types of on_delete behavior besides

Re: Database weirdness in test harness

2008-06-23 Thread Michael Glassford
Luke Plant wrote: > On Friday 20 June 2008 23:40:43 Michael Glassford wrote: >> Django builds a list of all the objects that are foreign keyed to >> the one you are deleting and deletes those first, so it bypasses >> any ON DELETE clauses. I assume this is what you're seeing. > > Yes, this is the

Re: Database weirdness in test harness

2008-06-21 Thread Luke Plant
On Friday 20 June 2008 23:30:07 Luke Plant wrote: > Hi all, > > I'm trying to pin down what I think is a bug in Model.delete() OK, here is the situation. Suppose you have 4 models, A, B, C, D, with foreign keys from one model to another represented by '->' A B -> A C -> B D -> C D -> A Suppose

Re: Database weirdness in test harness

2008-06-21 Thread Luke Plant
On Saturday 21 June 2008 07:08:52 Russell Keith-Magee wrote: > On Sat, Jun 21, 2008 at 6:30 AM, Luke Plant <[EMAIL PROTECTED]> wrote: > > Hi all, > > Hi Luke - Great to see you back and committing again! :-) Thanks, I was at busy at college for 2 year -- I can't believe it's been 2 years since

Re: Database weirdness in test harness

2008-06-20 Thread Russell Keith-Magee
On Sat, Jun 21, 2008 at 6:30 AM, Luke Plant <[EMAIL PROTECTED]> wrote: > Hi all, Hi Luke - Great to see you back and committing again! :-) > Currently the tests pass, but they shouldn't -- the DELETE statement > should produce an IntegrityError or OperationalError (or, if 'ON > DELETE CASCADE' w

Re: Database weirdness in test harness

2008-06-20 Thread Luke Plant
On Friday 20 June 2008 23:40:43 Michael Glassford wrote: > Django builds a list of all the objects that are foreign keyed to > the one you are deleting and deletes those first, so it bypasses > any ON DELETE clauses. I assume this is what you're seeing. Yes, this is the area I'm testing, I'm awar

Re: Database weirdness in test harness

2008-06-20 Thread Michael Glassford
Django builds a list of all the objects that are foreign keyed to the one you are deleting and deletes those first, so it bypasses any ON DELETE clauses. I assume this is what you're seeing. I'm preparing to propose a patch that will add ON DELETE and ON UPDATE support to Django (so that you c

Database weirdness in test harness

2008-06-20 Thread Luke Plant
Hi all, I'm trying to pin down what I think is a bug in Model.delete(), but I'm encountering bizarre behaviour with my tests that I can't reproduce in normal circumstances. In particular, it is as if foreign key constraint checking has been turned off. The attached patch adds tests that can b