#NEWLINE# def test_cascading_deletion( app ) : #NEWLINE# #INDENT# entity = Entity ( name = 'test_cascading_deletion' ) . save ( ) #NEWLINE# post = Post . new ( entity = entity , content = { #NEWLINE# #INDENT# 'a' : 'b' , #NEWLINE# #UNINDENT# } , schema = 'http://example.com/thisisnotrelevant' ) . save ( ) #NEWLINE# assert ( post in Post . objects ) #NEWLINE# assert ( post in entity . posts ) #NEWLINE# entity . delete ( ) #NEWLINE# assert ( post not in Post . objects ) #NEWLINE# assert ( post not in entity . posts )