Fixed ordering-related failure in m2m_through_regress tests
This commit is contained in:
parent
bf1871d874
commit
dc569c8801
|
@ -75,6 +75,9 @@ class Driver(models.Model):
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "%s" % self.name
|
return "%s" % self.name
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
ordering = ('name',)
|
||||||
|
|
||||||
@python_2_unicode_compatible
|
@python_2_unicode_compatible
|
||||||
class CarDriver(models.Model):
|
class CarDriver(models.Model):
|
||||||
car = models.ForeignKey('Car', to_field='make')
|
car = models.ForeignKey('Car', to_field='make')
|
||||||
|
|
|
@ -168,7 +168,7 @@ class ToFieldThroughTests(TestCase):
|
||||||
self.car.drivers._add_items('car', 'driver', self.unused_driver)
|
self.car.drivers._add_items('car', 'driver', self.unused_driver)
|
||||||
self.assertQuerysetEqual(
|
self.assertQuerysetEqual(
|
||||||
self.car.drivers.all(),
|
self.car.drivers.all(),
|
||||||
["<Driver: Ryan Briscoe>", "<Driver: Barney Gumble>"]
|
["<Driver: Barney Gumble>", "<Driver: Ryan Briscoe>"]
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_add_null(self):
|
def test_add_null(self):
|
||||||
|
|
Loading…
Reference in New Issue