29

I'm trying to create some Functional tests for a Django app that uses South migrations.
Eventually, I will also be creating Twill tests.

When I try to run the existing tests, the test database is not created successfully because of a problem with the South migrations. ( Fails @ 7th of 58 migrations )

It would seem that for the purpose of testing, it's better to build the test database from the Django models, like a syncdb would, than from South.

How do I set up the Django test suite to build the test database from the current model vs. trying to use South?

Robert Martin
  • 15,401
  • 15
  • 52
  • 84
BryanWheelock
  • 11,386
  • 18
  • 60
  • 101
  • But... but your test is failing? What if someone needs to upgrade from your migrations? They can't. Can't you fix the migrations? –  Nov 20 '14 at 23:11

1 Answers1

64

The South setting SOUTH_TESTS_MIGRATE controls this behaviour.

Add this line to your settings.py file:

SOUTH_TESTS_MIGRATE = False
bignose
  • 24,957
  • 12
  • 70
  • 100
Leopd
  • 37,882
  • 29
  • 117
  • 156
  • 4
    Don't you love it when you find an unexpected problem but then the developers already thought of it and included an easy fix? –  Jan 15 '14 at 16:03