#NEWLINE# def test_m2m( self ) : #NEWLINE# #INDENT# m = M . objects . create ( ) #NEWLINE# r = R . objects . create ( ) #NEWLINE# MR . objects . create ( m = m , r = through ) #NEWLINE# r . delete ( ) #NEWLINE# self . assertFalse ( MR . objects . exists ( ) ) #NEWLINE# r = R . objects . create ( ) #NEWLINE# MR . objects . create ( m = m , r = r ) #NEWLINE# m . delete ( ) #NEWLINE# self . assertFalse ( MR . objects . exists ( ) ) #NEWLINE# m = M . objects . create ( ) #NEWLINE# r = R . objects . create ( ) #NEWLINE# m . m2m . add ( r ) #NEWLINE# r . delete ( ) #NEWLINE# through = M . _meta . get_field ( 'm2m' ) . rel . through #NEWLINE# self . assertFalse ( through . objects . exists ( ) ) #NEWLINE# r = R . objects . create ( ) #NEWLINE# m . m2m . add ( r ) #NEWLINE# m . delete ( ) #NEWLINE# self . assertFalse ( through . objects . exists ( ) ) #NEWLINE# m = M . objects . create ( ) #NEWLINE# r = R . objects . create ( ) #NEWLINE# MRNull . objects . create ( m = m , r = r ) #NEWLINE# r . delete ( ) #NEWLINE# self . assertFalse ( ( not MRNull . objects . exists ( ) ) ) #NEWLINE# self . assertFalse ( m . m2m_through_null . exists ( ) )