Disable Django South when running unit tests? How do you avoid running all of the south migrations when doing django unit testing?
You can selectively disable migration for one or more Django-Models by setting managed = False in Django Model Meta options.
Writing testsDjango's unit tests use a Python standard library module: unittest . This module defines tests using a class-based approach. When you run your tests, the default behavior of the test utility is to find all the test cases (that is, subclasses of unittest.
django-test-migrationsSet some migration as a starting point. Create some model's data that you want to test. Run the new migration that you are testing. Assert the results!
Yes, the South documentation describes how to do it, but basically just add this to your settings.py file:
SOUTH_TESTS_MIGRATE = False # To disable migrations and use syncdb instead SKIP_SOUTH_TESTS = True # To disable South's own unit tests
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With