On Wed, Jan 14, 2009 at 9:34 AM, Giovannetti, Mark
<[email protected]> wrote:
>
> Is there a way to force a fixture to be loaded first
> when running manage.py test?
>
> I'd like to load a content_types.json fixture immediately
> before any other fixtures are loaded.
>
> This might fix some of the vexing problems with using
> content_types and tests.

As far as I can make out, this would fix exactly none of the content
type problems. The problem with content types is that content types
are dynamically generated, and as a result they are not produced with
predictable or consistent key values. As long as you serialize all
your content types in your fixture, and you haven't added any new
content types since producing the fixture, you shouldn't have any
problems deserializing data.

> Anyone know if this is possible?

No, it isn't possible, and it doesn't really make much sense, either.
Fixtures are all loaded in a single database transaction, so the order
in which fixtures are loaded doesn't matter.

The only exception to this is if you're using InnoDB tables under
MySQL, in which case the problem is MySQL's implementation of
transactions (specifically, InnoDB doesn't allow deferring of
referential integrity checks to the end of the transaction boundary as
it should).

Of course, it's entirely possible you've found an new class of problem
that I wasn't previously aware of, in which case I'd be interested to
hear exactly what you've done and how fixture order fixes the problem.

Yours,
Russ Magee %-)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to