diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2009-04-11 02:12:31 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2009-04-11 02:12:31 +0000 |
| commit | 604c5bc52a2de713166351d4ca73b0072bd8e232 (patch) | |
| tree | 645618090853f822ed87b30a3d19e39499143d2b /tests | |
| parent | e07a3a278ed27b95ed7ec53b97d991fad3b33aa6 (diff) | |
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
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/modeltests/unmanaged_models/models.py | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/tests/modeltests/unmanaged_models/models.py b/tests/modeltests/unmanaged_models/models.py index 4402090582..ca9b05aca4 100644 --- a/tests/modeltests/unmanaged_models/models.py +++ b/tests/modeltests/unmanaged_models/models.py @@ -91,19 +91,33 @@ class Intermediate(models.Model): # # These next models test the creation (or not) of many to many join tables -# between managed and unmanaged models. A join table between two unmanaged -# models shouldn't be automatically created (see #10647). +# between managed and unmanaged models. A join table between two unmanaged +# models shouldn't be automatically created (see #10647). # -class Unmanaged1(models.Model): + +# 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 Meta: managed = False + db_table = "unmanaged_models_proxy1" # Unmanged with an m2m to unmanaged: the intermediary table won't be created. class Unmanaged2(models.Model): mm = models.ManyToManyField(Unmanaged1) - + class Meta: managed = False + db_table = "unmanaged_models_proxy2" # 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). |
