Fixed the tests from #10455 so that they are set up correctly.

The previous versions only worked on SQLite. They failed
catastrophically on MySQL & PostgreSQL.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10506 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2009-04-11 02:12:31 +00:00
parent e07a3a278e
commit 604c5bc52a
1 changed files with 18 additions and 4 deletions

View File

@ -94,9 +94,22 @@ class Intermediate(models.Model):
# between managed and unmanaged models. A join table between two unmanaged # between managed and unmanaged models. A join table between two unmanaged
# models shouldn't be automatically created (see #10647). # models shouldn't be automatically created (see #10647).
# #
# Firstly, we need some models that will create the tables, purely so that the
# tables are created. This is a test setup, not a requirement for unmanaged
# models.
class Proxy1(models.Model):
class Meta:
db_table = "unmanaged_models_proxy1"
class Proxy2(models.Model):
class Meta:
db_table = "unmanaged_models_proxy2"
class Unmanaged1(models.Model): class Unmanaged1(models.Model):
class Meta: class Meta:
managed = False managed = False
db_table = "unmanaged_models_proxy1"
# Unmanged with an m2m to unmanaged: the intermediary table won't be created. # Unmanged with an m2m to unmanaged: the intermediary table won't be created.
class Unmanaged2(models.Model): class Unmanaged2(models.Model):
@ -104,6 +117,7 @@ class Unmanaged2(models.Model):
class Meta: class Meta:
managed = False managed = False
db_table = "unmanaged_models_proxy2"
# Here's an unmanaged model with an m2m to a managed one; the intermediary # Here's an unmanaged model with an m2m to a managed one; the intermediary
# table *will* be created (unless given a custom `through` as for C02 above). # table *will* be created (unless given a custom `through` as for C02 above).