'Test that Django cascades deletes through generic-related
objects to their reverse relations.
This might falsely succeed if the database cascades deletes
itself immediately; the postgresql_psycopg2 backend does not
give such a false success because ForeignKeys are created with
DEFERRABLE INITIALLY DEFERRED, so its internal cascade is
delayed until transaction commit.'

def test_generic_relation_cascade(self):

    person = Person.objects.create(name='Nelson    Mandela')
    award = Award.objects.create(name='Nobel', content_object=person)
    note = AwardNote.objects.create(note='a    peace    prize', award=award)
    self.assertEquals(AwardNote.objects.count(), 1)
    person.delete()
    self.assertEquals(Award.objects.count(), 0)
    self.assertEquals(AwardNote.objects.count(), 0)
