Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 Gaynor authored
2  tests/modeltests/generic_relations/models.py
@@ -23,7 +23,7 @@ class TaggedItem(models.Model):
23 23
     content_object = generic.GenericForeignKey()
24 24
 
25 25
     class Meta:
26  
-        ordering = ["tag", "-object_id"]
  26
+        ordering = ["tag", "content_type__name"]
27 27
 
28 28
     def __unicode__(self):
29 29
         return self.tag
8  tests/modeltests/generic_relations/tests.py
@@ -88,8 +88,8 @@ def test_generic_relations(self):
88 88
 
89 89
         self.assertQuerysetEqual(TaggedItem.objects.all(), [
90 90
                 (u'clearish', Mineral, quartz.pk),
91  
-                (u'fatty', Vegetable, bacon.pk),
92 91
                 (u'fatty', Animal, platypus.pk),
  92
+                (u'fatty', Vegetable, bacon.pk),
93 93
                 (u'hairy', Animal, lion.pk),
94 94
                 (u'salty', Vegetable, bacon.pk),
95 95
                 (u'shiny', Animal, platypus.pk),
@@ -100,8 +100,8 @@ def test_generic_relations(self):
100 100
         lion.delete()
101 101
         self.assertQuerysetEqual(TaggedItem.objects.all(), [
102 102
                 (u'clearish', Mineral, quartz.pk),
103  
-                (u'fatty', Vegetable, bacon.pk),
104 103
                 (u'fatty', Animal, platypus.pk),
  104
+                (u'fatty', Vegetable, bacon.pk),
105 105
                 (u'salty', Vegetable, bacon.pk),
106 106
                 (u'shiny', Animal, platypus.pk)
107 107
             ],
@@ -114,8 +114,8 @@ def test_generic_relations(self):
114 114
         quartz.delete()
115 115
         self.assertQuerysetEqual(TaggedItem.objects.all(), [
116 116
                 (u'clearish', Mineral, quartz_pk),
117  
-                (u'fatty', Vegetable, bacon.pk),
118 117
                 (u'fatty', Animal, platypus.pk),
  118
+                (u'fatty', Vegetable, bacon.pk),
119 119
                 (u'salty', Vegetable, bacon.pk),
120 120
                 (u'shiny', Animal, platypus.pk)
121 121
             ],
@@ -123,7 +123,7 @@ def test_generic_relations(self):
123 123
         )
124 124
         # If you delete a tag, the objects using the tag are unaffected
125 125
         # (other than losing a tag)
126  
-        tag = TaggedItem.objects.get(id=1)
  126
+        tag = TaggedItem.objects.order_by("id")[0]
127 127
         tag.delete()
128 128
         self.assertQuerysetEqual(bacon.tags.all(), ["<TaggedItem: salty>"])
129 129
         self.assertQuerysetEqual(TaggedItem.objects.all(), [

0 notes on commit 2a33115

Please sign in to comment.
Something went wrong with that request. Please try again.