Re: [GENERAL] Unit tests and foreign key constraints

2015-05-21 Thread Andy Chambers
On Thu, May 21, 2015 at 1:34 PM, Martijn van Oosterhout wrote: > On Thu, May 21, 2015 at 12:39:01PM -0700, Andy Chambers wrote: > > Hey All, > > > > I've started trying to use foreign key constraints in my schema but it > > seems to make it more difficult to write unit tests that touch the > data

Re: [GENERAL] Unit tests and foreign key constraints

2015-05-21 Thread Martijn van Oosterhout
On Thu, May 21, 2015 at 01:33:46PM -0700, Dave Owens wrote: > > > > I know some say your unit tests shouldn't touch the DB but the more full > > stack tests I have, the better I sleep at night :-)) > > > > Unit tests really should be about testing individual bits of logic. Does a > single method

Re: [GENERAL] Unit tests and foreign key constraints

2015-05-21 Thread Dave Owens
> > I know some say your unit tests shouldn't touch the DB but the more full > stack tests I have, the better I sleep at night :-)) > Unit tests really should be about testing individual bits of logic. Does a single method do the desired thing, and not the undesired thing... Ideally, your data ac

Re: [GENERAL] Unit tests and foreign key constraints

2015-05-21 Thread Martijn van Oosterhout
On Thu, May 21, 2015 at 12:39:01PM -0700, Andy Chambers wrote: > Hey All, > > I've started trying to use foreign key constraints in my schema but it > seems to make it more difficult to write unit tests that touch the database > because each test now requires more setup data to satisfy the foreign

[GENERAL] Unit tests and foreign key constraints

2015-05-21 Thread Andy Chambers
Hey All, I've started trying to use foreign key constraints in my schema but it seems to make it more difficult to write unit tests that touch the database because each test now requires more setup data to satisfy the foreign key constraint. (I know some say your unit tests shouldn't touch the DB