diff --git a/tests/modeltests/transactions/models.py b/tests/modeltests/transactions/models.py index 06d21bbdd4..6763144ca5 100644 --- a/tests/modeltests/transactions/models.py +++ b/tests/modeltests/transactions/models.py @@ -14,6 +14,9 @@ class Reporter(models.Model): last_name = models.CharField(max_length=30) email = models.EmailField() + class Meta: + ordering = ('first_name', 'last_name') + def __unicode__(self): return u"%s %s" % (self.first_name, self.last_name) diff --git a/tests/regressiontests/null_fk/models.py b/tests/regressiontests/null_fk/models.py index 529dde5039..49887819ac 100644 --- a/tests/regressiontests/null_fk/models.py +++ b/tests/regressiontests/null_fk/models.py @@ -22,6 +22,9 @@ class Comment(models.Model): post = models.ForeignKey(Post, null=True) comment_text = models.CharField(max_length=250) + class Meta: + ordering = ('comment_text',) + def __unicode__(self): return self.comment_text diff --git a/tests/regressiontests/serializers_regress/tests.py b/tests/regressiontests/serializers_regress/tests.py index 4e52d81811..de7ddcc9f7 100644 --- a/tests/regressiontests/serializers_regress/tests.py +++ b/tests/regressiontests/serializers_regress/tests.py @@ -103,7 +103,7 @@ def data_compare(testcase, pk, klass, data): def generic_compare(testcase, pk, klass, data): instance = klass.objects.get(id=pk) testcase.assertEqual(data[0], instance.data) - testcase.assertEqual(data[1:], [t.data for t in instance.tags.all()]) + testcase.assertEqual(data[1:], [t.data for t in instance.tags.order_by('id')]) def fk_compare(testcase, pk, klass, data): instance = klass.objects.get(id=pk) @@ -111,7 +111,7 @@ def fk_compare(testcase, pk, klass, data): def m2m_compare(testcase, pk, klass, data): instance = klass.objects.get(id=pk) - testcase.assertEqual(data, [obj.id for obj in instance.data.all()]) + testcase.assertEqual(data, [obj.id for obj in instance.data.order_by('id')]) def im2m_compare(testcase, pk, klass, data): instance = klass.objects.get(id=pk)