summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2009-04-13 07:07:51 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2009-04-13 07:07:51 +0000
commitfd3ee7d7867dd13a336b90873ccb8df6302f2c05 (patch)
tree16aae299cabe6a7c7e7f5d2f773f605f1965206e /tests
parent0fec0a5d704d487755209115719ca173913a43b7 (diff)
Fixed #9804 -- Corrected the introspection of sequence names. This was causing problems when flushing tables that had many-to-many relations through an inherited table. Thanks to jdimov for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10552 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/m2m_through_regress/models.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/regressiontests/m2m_through_regress/models.py b/tests/regressiontests/m2m_through_regress/models.py
index b4135032a9..8594f19dee 100644
--- a/tests/regressiontests/m2m_through_regress/models.py
+++ b/tests/regressiontests/m2m_through_regress/models.py
@@ -35,6 +35,22 @@ class Group(models.Model):
def __unicode__(self):
return self.name
+# A set of models that use an non-abstract inherited model as the 'through' model.
+class A(models.Model):
+ a_text = models.CharField(max_length=20)
+
+class ThroughBase(models.Model):
+ a = models.ForeignKey(A)
+ b = models.ForeignKey('B')
+
+class Through(ThroughBase):
+ extra = models.CharField(max_length=20)
+
+class B(models.Model):
+ b_text = models.CharField(max_length=20)
+ a_list = models.ManyToManyField(A, through=Through)
+
+
__test__ = {'API_TESTS':"""
# Create some dummy data
>>> bob = Person.objects.create(name='Bob')
@@ -176,4 +192,8 @@ doing a join.
>>> bob.group_set.filter(membership__price=50)
[<Group: Roll>]
+## Regression test for #9804
+# Flush the database, just to make sure we can.
+>>> management.call_command('flush', verbosity=0, interactive=False)
+
"""}