Ticket #15776: 15776.deletion_order.diff
File 15776.deletion_order.diff, 1.1 KB (added by , 14 years ago) |
---|
-
django/db/models/deletion.py
237 237 {field.name: value}, self.using) 238 238 239 239 # reverse instance collections 240 for instances in self.data.itervalues(): 241 instances.reverse() 240 self.data.keyOrder.reverse() 242 241 243 242 # delete batches 244 243 for model, batches in self.batches.iteritems(): -
tests/modeltests/delete/tests.py
206 206 t2 = T.objects.create(pk=2, s=s2) 207 207 r.delete() 208 208 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)] 210 210 ) 211 211 self.assertEqual( 212 212 post_delete_order, [(T, 1), (T, 2), (S, 1), (S, 2), (R, 1)]