From 0d3ec8d0fb74424bb49e3169d5d051a36e8d2348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anssi=20K=C3=A4=C3=A4ri=C3=A4inen?= Date: Sat, 24 Nov 2012 15:52:00 +0200 Subject: [PATCH] [1.5.x] Fixed ordering-related failure in m2m_through_regress tests Backpatch of dc569c880143db07e01b3293d698ad8fe4a0136f --- tests/regressiontests/m2m_through_regress/models.py | 3 +++ tests/regressiontests/m2m_through_regress/tests.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/regressiontests/m2m_through_regress/models.py b/tests/regressiontests/m2m_through_regress/models.py index 23d3366f22..91e1aa8cc1 100644 --- a/tests/regressiontests/m2m_through_regress/models.py +++ b/tests/regressiontests/m2m_through_regress/models.py @@ -75,6 +75,9 @@ class Driver(models.Model): def __str__(self): return "%s" % self.name + class Meta: + ordering = ('name',) + @python_2_unicode_compatible class CarDriver(models.Model): car = models.ForeignKey('Car', to_field='make') diff --git a/tests/regressiontests/m2m_through_regress/tests.py b/tests/regressiontests/m2m_through_regress/tests.py index 828ec3618c..eba956b3ba 100644 --- a/tests/regressiontests/m2m_through_regress/tests.py +++ b/tests/regressiontests/m2m_through_regress/tests.py @@ -168,7 +168,7 @@ class ToFieldThroughTests(TestCase): self.car.drivers._add_items('car', 'driver', self.unused_driver) self.assertQuerysetEqual( self.car.drivers.all(), - ["", ""] + ["", ""] ) def test_add_null(self):