Permalink
Browse files

[1.4.x] Fixed ordering-related failure in m2m_through_regress tests

Backpatch of dc569c8
  • Loading branch information...
akaariai committed Nov 24, 2012
1 parent 046300c commit 3e4058be9f3f7bc58a356278a70d44c07f1c967c
@@ -66,6 +66,9 @@ class Driver(models.Model):
def __unicode__(self):
return "%s" % self.name
+ class Meta:
+ ordering = ('name',)
+
class CarDriver(models.Model):
car = models.ForeignKey('Car', to_field='make')
driver = models.ForeignKey('Driver', to_field='name')
@@ -172,7 +172,7 @@ def test_add(self):
self.car.drivers._add_items('car', 'driver', self.unused_driver)
self.assertQuerysetEqual(
self.car.drivers.all(),
- ["<Driver: Ryan Briscoe>", "<Driver: Barney Gumble>"]
+ ["<Driver: Barney Gumble>", "<Driver: Ryan Briscoe>"]
)
def test_add_null(self):

0 comments on commit 3e4058b

Please sign in to comment.