On Jan 14, 2:53 am, Russell Keith-Magee <[email protected]>
wrote:
> On Wed, Jan 14, 2009 at 9:34 AM, Giovannetti, Mark
>
> <[email protected]> wrote:
>
> > Is there a way to force afixtureto be loaded first
> > when running manage.py test?
>
> > I'd like to load a content_types.jsonfixtureimmediately
> > 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 yourfixture, and you haven't added any new
> content types since producing thefixture, 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 howfixtureorder fixes the problem.
>
For me, there are issues with tests and content_type fixtures beyond
just their dynamic creation. I need to put together a decent test case
when I have time, but querying a content type via a GenericForeignKey
on another model produces consistently inconsistent and broken
results.
Andy
> 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
-~----------~----~----~----~------~----~------~--~---