Ticket #7276: delete-parent-objects-test.diff

File delete-parent-objects-test.diff, 731 bytes (added by John Millikin, 16 years ago)

Updated model inheritance unit tests

  • tests/modeltests/model_inheritance/models.py

    === modified file 'tests/modeltests/model_inheritance/models.py'
     
    249249>>> list(ItalianRestaurant.objects.values('name', 'rating')) == [d]
    250250True
    251251
     252# Deleting a child will also delete the parent
     253>>> park1.parent.id
     2547
     255>>> Place.objects.get (id = 7)
     256<Place: Main St the place>
     257>>> park1.delete ()
     258>>> Place.objects.get (id = 7)
     259Traceback (most recent call last):
     260    ...
     261DoesNotExist: Place matching query does not exist.
     262
    252263# select_related works with fields from the parent object as if they were a
    253264# normal part of the model.
    254265>>> from django import db
Back to Top