testing django migrations

37 views
Skip to first unread message

varun naganathan

unread,
Dec 27, 2015, 5:14:36 AM12/27/15
to Django users
Hi,I wanted to know how am i supposed to test the working of django migrations.As in how the migrations generate the SQL query.Basically I want to inspect how the sql query generated as in the output of "./manage.py sqlmigrate" is being generated.I've generally used "pdb" along wth unittest.TestCase,but for migrations I'm pretty much stuck.Does anyone probably have a sample test they wrote to test the django migrations.
Thanks in advance.

Dan Tagg

unread,
Dec 27, 2015, 6:33:18 PM12/27/15
to django...@googlegroups.com
Hi,

I used this:

It's only worth writing tests if you are modifying code created by makemigrations.

Dan

On 27 December 2015 at 10:14, varun naganathan <varunnaga...@gmail.com> wrote:
Hi,I wanted to know how am i supposed to test the working of django migrations.As in how the migrations generate the SQL query.Basically I want to inspect how the sql query generated as in the output of "./manage.py sqlmigrate" is being generated.I've generally used "pdb" along wth unittest.TestCase,but for migrations I'm pretty much stuck.Does anyone probably have a sample test they wrote to test the django migrations.
Thanks in advance.

--
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/b6364f7e-56ab-4682-ad0a-3684e6199c8f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Wildman and Herring Limited, Registered Office: 52 Great Eastern Street, London, EC2A 3EP, Company no: 05766374

Gergely Polonkai

unread,
Dec 27, 2015, 7:09:33 PM12/27/15
to Django users

I'm also interested in that, except that I'd like to test RunPython steps.

Reply all
Reply to author
Forward
0 new messages