I agree we can just say that initial_data can be used as a fixture for
tests rather than being auto-loaded - and we could perhaps even put it in
the base testcase so it always auto-applied somehow - but that doesn't get
over the fact that you can't rely on data migrations to set up your
database for tests (for example, to add in required base rows or choices to
EAV designs).

I remember we reordered TransactionTestCase with respect to TestCase - what
did we do? If we had them all at the end then we could at least have things
work for TestCase if we remove that initial flush, but unfortunately I
suspect option 3 might have to be the solution, and I really don't want to
do anything with fixtures (though I guess the only performance hit is
writing the fixture, as we would have been reading one in every time before
anyway - initial_data). Perhaps we could cache the fixture in memory and
then spool out to disk if it gets too big.

Andrew


On Sat, Apr 19, 2014 at 5:20 AM, Andrey Antukh <n...@niwi.be> wrote:

> 2014-04-19 14:15 GMT+02:00 Anssi Kääriäinen <anssi.kaariai...@thl.fi>:
>
> On 04/19/2014 10:52 AM, Anssi Kääriäinen wrote:
>>
>>  Getting dump-and-reload support for 1.7 seems hard, so from the above
>>> options this leaves just 2) - not deprecating initial_data yet. Or we
>>> need to find some other solution not listed above.
>>>
>> Hmmh, there is actually a pretty straightforward upgrade path for this
>> case. Just rename your initial_data fixtures to something else, and add
>> them as normal testing fixtures in your TestCases. Of course, this requires
>> some work to do, but it is a viable upgrade path.
>>
>> It is clear that migrations can't be used as a replacement for
>> initial_data when testing, so we need some improvements to the release
>> notes in any case.
>>
>
> Completely agree with you.
>
> +1
>
>
>>
>>
>
>>  - Anssi
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-developers+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-developers@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-developers.
>> To view this discussion on the web visit https://groups.google.com/d/
>> msgid/django-developers/535268EF.3010903%40thl.fi.
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Andrey Antukh - Андрей Антух - <andrei.anto...@kaleidos.net> / <
> n...@niwi.be>
> http://www.niwi.be <http://www.niwi.be/page/about/>
> https://github.com/niwibe
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/CAKn%3DmOOE34RsCMprPCLfCT0o8KUArNoXGKXrDRapbNNSg4u%2BkA%40mail.gmail.com<https://groups.google.com/d/msgid/django-developers/CAKn%3DmOOE34RsCMprPCLfCT0o8KUArNoXGKXrDRapbNNSg4u%2BkA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAFwN1uobwrJ_rcguNfD3wxwZ0eF9gd5cKvCmbUndV5Vpw3gang%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to