﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
22459	Creating model classes for test purposes breaks migrations	Paolo Dente	nobody	"Defining a model class in a test file like this:

{{{
class BasicModel(models.Model):
    title = models.CharField(max_length=255)
}}}

results in the test breaking immediately with a CommandError:

{{{
CommandError: Database test_db couldn't be flushed. Possible reasons:
  * The database isn't running or isn't configured correctly.
  * At least one of the expected database tables doesn't exist.
  * The SQL was invalid.
Hint: Look at the output of 'django-admin.py sqlflush'. That's the SQL this command wasn't able to run.
The full error: relation ""appname_basicmodel"" does not exist
}}}

Since it is no longer possible to disable migrations for testing, a possible solution would be either allowing specific models to be marked as non-migrated, or avoiding flushing of non-existing tables."	Cleanup/optimization	closed	Migrations	dev	Normal	duplicate			Accepted	0	0	0	0	0	0
