Re: Migrations in Django 1.7 make unit testing models harder

2014-03-28 Thread Bernie Sumption
> > South's `--update` also rolled the previous migration back, changed it and > then reapplied it to the current database. > OK, in that case I can very much see how it's useful for people who develop against a persistent database. That's probably most people. Anyway, the result of this threa

Re: Migrations in Django 1.7 make unit testing models harder

2014-03-28 Thread Bernie Sumption
> That script would be bad if you'd run any of those migrations against your > development db (yes it should be "throwaway" or rebuildable but...) > I'd think the same could be said of --update? As I understand it, --update is the equivalent of deleting the most recent migration and recreating

Re: Migrations in Django 1.7 make unit testing models harder

2014-03-28 Thread Bernie Sumption
OK, it turns out that the "safe update migrations script" too simple to even qualify as a "script": git clean myapp/migrations -f && python manage.py makemigrations Perhaps the solution is to document this on the testing page as a solution to the "accumulation of many small migrations during de

Re: Migrations in Django 1.7 make unit testing models harder

2014-03-28 Thread Bernie Sumption
The problem with --update is that if overwrites the most recent migration, then it might be used to modify a committed and distributed migration, which is a Bad Thing. The flag would probably be useful to people with my use case, if they trust themselves to use the flag with care and remember t

Re: Migrations in Django 1.7 make unit testing models harder

2014-03-27 Thread Bernie Sumption
> > I'd be willing to keep the current contract of "things without a > migrations directory don't get migrated", but I suspect you're doing things > on apps that already have migrations (which makes my reticence to add a > setting even bigger - if you "syncdb" an app with migrations to a main

Re: Migrations in Django 1.7 make unit testing models harder

2014-03-26 Thread Bernie Sumption
> > we can't promote adding random strings to MIGRATION_MODULES as the > suggested way to "get around" migrations for tests. > I agree, my workaround is a hack. It would be better to introduce a flag or setting designed specifically for this use case. > In my opinion, the whole point of migr

Migrations in Django 1.7 make unit testing models harder

2014-03-25 Thread Bernie Sumption
Hi Django devs, I've just started a new project in 1.7b, and the development experience working with unit tests on models is more complicated than it was in 1.6. It's all down to how the throwaway test databases are created. In 1.6, the create_test_db function "Creates a new test database and r