manage.py --keepdb VS DataMigration as Initial Data

34 views
Skip to first unread message

Carlos Leite

unread,
Feb 11, 2016, 1:16:20 PM2/11/16
to Django INT
Hi there, 

I'm running a Django==1.8 app 
I read in the docs [1], to consider doing a data migration to load initial data on db, since  initial fixture is consider deprecated since 1.7. 

Well, to keep my app up-to-date I choose to load "initial data" trough a  data migration. 

My problem, SEEMS to be when I run tests using the "--keepdb" 

$> python manage.py --keepdb 

The second time I run into tests, the inital data is loss! 

is there a pattern to solve that, or i need code on tests to check de initial data and reload it ?



---------------------------------------------------------------------
Cadu Leite

G+:  google.com/+CarlosLeite
twitter: @cadu_leite
site: http://people.python.org.br/

Tim Graham

unread,
Feb 11, 2016, 6:59:55 PM2/11/16
to Django users
You might be running into the same problem reported in https://code.djangoproject.com/ticket/25251#comment:3

Carlos Leite

unread,
Feb 11, 2016, 8:14:38 PM2/11/16
to Django INT
Exactly . thanks. I'm happy i'm not alone ;) ...  and did nothing wrong.
..  I was thinking what could be done in the core to solve...

The easyiest way, is keeping flushing data at the end of the tests,
but run data inserts  in migrations when the tests starts, even when --keepdb is present

...  still thinking



.

---------------------------------------------------------------------
Cadu Leite

G+:  google.com/+CarlosLeite
twitter: @cadu_leite
site: http://people.python.org.br/

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/644e763e-330e-48fc-9912-10fa548d9461%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages