Ticket #15776: 15776.deletion_order.diff

File 15776.deletion_order.diff, 1.1 KB (added by Johannes Dollinger, 14 years ago)
  • django/db/models/deletion.py

     
    237237                                   {field.name: value}, self.using)
    238238
    239239        # reverse instance collections
    240         for instances in self.data.itervalues():
    241             instances.reverse()
     240        self.data.keyOrder.reverse()
    242241
    243242        # delete batches
    244243        for model, batches in self.batches.iteritems():
  • tests/modeltests/delete/tests.py

     
    206206        t2 = T.objects.create(pk=2, s=s2)
    207207        r.delete()
    208208        self.assertEqual(
    209             pre_delete_order, [(T, 2), (T, 1), (S, 2), (S, 1), (R, 1)]
     209            pre_delete_order, [(R, 1), (S, 1), (S, 2), (T, 1), (T, 2)]
    210210        )
    211211        self.assertEqual(
    212212            post_delete_order, [(T, 1), (T, 2), (S, 1), (S, 2), (R, 1)]
Back to Top