Model relationships in tests


#1

I’m finding that its a pain to create yml files for tests where there
are relationships between tables/classes.
For example, I might have something like this:

vehicle.yml
red_ford:
id:1
owner_id:2

owner.yml
ford_owner:
id:2
address_id:5

address.yml
home_address:
id:5
etc.

To build up complex test relations, I have to edit all three files,
keeping track of the ids / fkeys for each test case. I’ve thought about
skipping foreign keys altogether in the fixtures and creating the
relations programmatically in the test, or possibly writing a custom
fixture generator of some sort. I know I could create the relations in
the db one way or the other and export, but that is not much better.

Any ideas/thoughts on this would be appreciated!
Keith