summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2011-03-04 00:01:56 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2011-03-04 00:01:56 +0000
commit185b4f49ca2e61c62208425c06bb6a19a25eaca3 (patch)
tree580afaf0ec3fd5083a14a89055c56a6415292ea5 /tests
parent806bffcf08893fc9a5104b3a1208551a5627473e (diff)
downloaddjango-185b4f49ca2e61c62208425c06bb6a19a25eaca3.tar.gz
Fixed #15548 -- Added an ordering clause to prevent test failures under Postgres. Thanks to bberes for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15743 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/modeladmin/models.py3
-rw-r--r--tests/regressiontests/modeladmin/tests.py4
2 files changed, 5 insertions, 2 deletions
diff --git a/tests/regressiontests/modeladmin/models.py b/tests/regressiontests/modeladmin/models.py
index cb2e3d1b0b..2eda54e7fb 100644
--- a/tests/regressiontests/modeladmin/models.py
+++ b/tests/regressiontests/modeladmin/models.py
@@ -9,6 +9,9 @@ class Band(models.Model):
bio = models.TextField()
sign_date = models.DateField()
+ class Meta:
+ ordering = ('name',)
+
def __unicode__(self):
return self.name
diff --git a/tests/regressiontests/modeladmin/tests.py b/tests/regressiontests/modeladmin/tests.py
index 4487da4377..a20e579026 100644
--- a/tests/regressiontests/modeladmin/tests.py
+++ b/tests/regressiontests/modeladmin/tests.py
@@ -154,9 +154,9 @@ class ModelAdminTests(TestCase):
self.assertEqual(str(form["main_band"]),
'<select name="main_band" id="id_main_band">\n'
'<option value="" selected="selected">---------</option>\n'
- '<option value="%d">The Doors</option>\n'
'<option value="%d">The Beatles</option>\n'
- '</select>' % (self.band.id, band2.id))
+ '<option value="%d">The Doors</option>\n'
+ '</select>' % (band2.id, self.band.id))
class AdminConcertForm(forms.ModelForm):
class Meta: