Author: Alex Date: 2010-10-16 20:49:36 -0500 (Sat, 16 Oct 2010) New Revision: 14241
Modified: django/trunk/tests/modeltests/generic_relations/models.py django/trunk/tests/modeltests/generic_relations/tests.py django/trunk/tests/regressiontests/test_utils/python_25.py Log: Corrected a suite of test failures when running under postgres. Modified: django/trunk/tests/modeltests/generic_relations/models.py =================================================================== --- django/trunk/tests/modeltests/generic_relations/models.py 2010-10-16 20:51:06 UTC (rev 14240) +++ django/trunk/tests/modeltests/generic_relations/models.py 2010-10-17 01:49:36 UTC (rev 14241) @@ -23,7 +23,7 @@ content_object = generic.GenericForeignKey() class Meta: - ordering = ["tag", "-object_id"] + ordering = ["tag", "content_type__name"] def __unicode__(self): return self.tag Modified: django/trunk/tests/modeltests/generic_relations/tests.py =================================================================== --- django/trunk/tests/modeltests/generic_relations/tests.py 2010-10-16 20:51:06 UTC (rev 14240) +++ django/trunk/tests/modeltests/generic_relations/tests.py 2010-10-17 01:49:36 UTC (rev 14241) @@ -88,8 +88,8 @@ self.assertQuerysetEqual(TaggedItem.objects.all(), [ (u'clearish', Mineral, quartz.pk), + (u'fatty', Animal, platypus.pk), (u'fatty', Vegetable, bacon.pk), - (u'fatty', Animal, platypus.pk), (u'hairy', Animal, lion.pk), (u'salty', Vegetable, bacon.pk), (u'shiny', Animal, platypus.pk), @@ -100,8 +100,8 @@ lion.delete() self.assertQuerysetEqual(TaggedItem.objects.all(), [ (u'clearish', Mineral, quartz.pk), + (u'fatty', Animal, platypus.pk), (u'fatty', Vegetable, bacon.pk), - (u'fatty', Animal, platypus.pk), (u'salty', Vegetable, bacon.pk), (u'shiny', Animal, platypus.pk) ], @@ -114,8 +114,8 @@ quartz.delete() self.assertQuerysetEqual(TaggedItem.objects.all(), [ (u'clearish', Mineral, quartz_pk), + (u'fatty', Animal, platypus.pk), (u'fatty', Vegetable, bacon.pk), - (u'fatty', Animal, platypus.pk), (u'salty', Vegetable, bacon.pk), (u'shiny', Animal, platypus.pk) ], @@ -123,7 +123,7 @@ ) # 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(), [ Modified: django/trunk/tests/regressiontests/test_utils/python_25.py =================================================================== --- django/trunk/tests/regressiontests/test_utils/python_25.py 2010-10-16 20:51:06 UTC (rev 14240) +++ django/trunk/tests/regressiontests/test_utils/python_25.py 2010-10-17 01:49:36 UTC (rev 14241) @@ -11,13 +11,11 @@ pass with self.assertNumQueries(1): - # Guy who wrote Linux - Person.objects.create(name="Linus Torvalds") + Person.objects.count() with self.assertNumQueries(2): - # Guy who owns the bagel place I like - Person.objects.create(name="Uncle Ricky") - self.assertEqual(Person.objects.count(), 2) + Person.objects.count() + Person.objects.count() def test_failure(self): with self.assertRaises(AssertionError) as exc_info: -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-upda...@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.