initial_data fixtures using natural keys fail in tests with multiple databases
|Reported by:||David Cramer||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
If a fixture using natural keys is referenced before that database is created (in tests), then the fixture fails to load due to a "table does not exist" error (though may also throw database does not exist, since it may not have been created yet).
The reason for this is that objects are instantiated before they are actually created in the database, but they mapper only does this if they're not using natural keys. In the case where they are, it attempts to look them up from the database, rather than the existing in-memory instances.