Ralph,
Sorry for the delay. What I think is happening is that the fixture
data may be being loaded out of order (``mymodel`` before ``user``),
resulting in the ``mymodel`` trying to save (and update the index)
before the ``user`` attribute is present. Without seeing the fixture
(or a stripped down example), it's difficult to tell.
You have a couple options. You could disable search for your tests
(in your test settings, set ``HAYSTACK_SEARCH_ENGINE = 'dummy'``), you
could use the regular ``SearchIndex`` instead of
``RealTimeSearchIndex`` (which doesn't automatically try to update the
index on save) or specify ``null=True`` on the field in question. Each
one of these three has their drawbacks (tests no longer perfectly
reflect standard setup/need to manually ``./manage.py update_index``
via cron on the live site/risk imperfect data loaded into the index on
the live setup just so tests work). I suspect option #2 is your best
bet, given that Whoosh will suffer locking issues (the "_MAIN_LOCK"
error) once you start serving traffic.
Daniel
> --
>
> You received this message because you are subscribed to the Google Groups "django-haystack" group.
> To post to this group, send email to
django-...@googlegroups.com.
> To unsubscribe from this group, send email to
django-haysta...@googlegroups.com.
> For more options, visit this group at
http://groups.google.com/group/django-haystack?hl=en.
>
>
>