summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2010-10-17 01:50:58 +0000
committerAlex Gaynor <alex.gaynor@gmail.com>2010-10-17 01:50:58 +0000
commit2a33115040557ae2cc348317ca799e293648fff7 (patch)
tree55923c0bc31616d831c3b6d331c9f438a8b46103
parent11713a8771221767f31718ef6406d276b435b9b0 (diff)
Corrected a suite of test failures when running under postgres. Backport of [14241].
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@14242 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--tests/modeltests/generic_relations/models.py2
-rw-r--r--tests/modeltests/generic_relations/tests.py8
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/modeltests/generic_relations/models.py b/tests/modeltests/generic_relations/models.py
index 6161f9ebea..18b77a355e 100644
--- a/tests/modeltests/generic_relations/models.py
+++ b/tests/modeltests/generic_relations/models.py
@@ -23,7 +23,7 @@ class TaggedItem(models.Model):
content_object = generic.GenericForeignKey()
class Meta:
- ordering = ["tag", "-object_id"]
+ ordering = ["tag", "content_type__name"]
def __unicode__(self):
return self.tag
diff --git a/tests/modeltests/generic_relations/tests.py b/tests/modeltests/generic_relations/tests.py
index e26db55ade..3d253010ff 100644
--- a/tests/modeltests/generic_relations/tests.py
+++ b/tests/modeltests/generic_relations/tests.py
@@ -88,8 +88,8 @@ class GenericRelationsTests(TestCase):
self.assertQuerysetEqual(TaggedItem.objects.all(), [
(u'clearish', Mineral, quartz.pk),
- (u'fatty', Vegetable, bacon.pk),
(u'fatty', Animal, platypus.pk),
+ (u'fatty', Vegetable, bacon.pk),
(u'hairy', Animal, lion.pk),
(u'salty', Vegetable, bacon.pk),
(u'shiny', Animal, platypus.pk),
@@ -100,8 +100,8 @@ class GenericRelationsTests(TestCase):
lion.delete()
self.assertQuerysetEqual(TaggedItem.objects.all(), [
(u'clearish', Mineral, quartz.pk),
- (u'fatty', Vegetable, bacon.pk),
(u'fatty', Animal, platypus.pk),
+ (u'fatty', Vegetable, bacon.pk),
(u'salty', Vegetable, bacon.pk),
(u'shiny', Animal, platypus.pk)
],
@@ -114,8 +114,8 @@ class GenericRelationsTests(TestCase):
quartz.delete()
self.assertQuerysetEqual(TaggedItem.objects.all(), [
(u'clearish', Mineral, quartz_pk),
- (u'fatty', Vegetable, bacon.pk),
(u'fatty', Animal, platypus.pk),
+ (u'fatty', Vegetable, bacon.pk),
(u'salty', Vegetable, bacon.pk),
(u'shiny', Animal, platypus.pk)
],
@@ -123,7 +123,7 @@ class GenericRelationsTests(TestCase):
)
# If you delete a tag, the objects using the tag are unaffected
# (other than losing a tag)
- tag = TaggedItem.objects.get(id=1)
+ tag = TaggedItem.objects.order_by("id")[0]
tag.delete()
self.assertQuerysetEqual(bacon.tags.all(), ["<TaggedItem: salty>"])
self.assertQuerysetEqual(TaggedItem.objects.all(), [