Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Corrected a suite of test failures when running under postgres. Backp…

…ort of [14241].

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@14242 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 2a33115040557ae2cc348317ca799e293648fff7 1 parent 11713a8
@alex alex authored
View
2  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
View
8 tests/modeltests/generic_relations/tests.py
@@ -88,8 +88,8 @@ def test_generic_relations(self):
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 @@ def test_generic_relations(self):
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 @@ def test_generic_relations(self):
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 @@ def test_generic_relations(self):
)
# 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(), [
Please sign in to comment.
Something went wrong with that request. Please try again.