On 11/30/2011 5:22 PM, Jeremy Dunck wrote:
Hi all,
   I've got a codebase with a fair bit of fixtures and have been
experiencing some pain around it.  One of the pains is migrating the
format of fixtures when a schema change occurs.

   I posted a thread to south-users to discuss the idea of adding a
feature to aid applying migrations to fixture data:
       
http://groups.google.com/group/south-users/browse_thread/thread/e358d13a55545082

   Evgeny responded that perhaps scripting generation of the fixture
was a good approach, and Carl responded that he thinks that generating
the needed test data in the TestCase itself is preferable.  Both
approaches avoid the immediate problem of wishing I could migrate
fixture data, because generating the data under their approaches
avoids having fixtures as an authoritative source of data.

   That surprised me a bit since I generally have viewed fixtures as
things to set up once.  Have others on the list tried these approaches
(or other approaches) and have any thoughts you'd like to share on it?

    In any case, I think it would be good to do one or both of the following:

    1) expand on the testing guide to present fixtures as one option
for test data and point out the options to script fixture generation
or avoiding fixtures in favor of TestCase-called generation,
discussing tradeoffs in the approaches
    2) add a django-admin testshell command which would act like
testserver - loading fixtures into a test DB and dropping you into the
shell to munge it as needed; this would be paired with a south feature
for applying migration fixtures.

   Feedback, please?
FWIW, this is the process I've used in the past: http://stackoverflow.com/questions/4002322/migrating-django-fixtures There's got to be a better way.

--Ned.

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

Reply via email to