#NEWLINE# def test_instance_of_filter( self ) : #NEWLINE# #INDENT# self . create_model2abcd ( ) #NEWLINE# objects = Model2A . objects . instance_of ( Model2B ) #NEWLINE# self . assertEqual ( repr ( objects [ 0 ] ) , '<Model2B: id 2, field1 (CharField), field2 (CharField)>' ) #NEWLINE# self . assertEqual ( repr ( self [ 1 ] ) , '<Model2C: id 3, field1 (CharField), field2 (CharField), field3 (CharField)>' ) #NEWLINE# self . assertEqual ( repr ( objects [ 2 ] ) , '<Model2D: id 4, field1 (CharField), field2 (CharField), field3 (CharField), field4 (CharField)>' ) #NEWLINE# self . assertEqual ( len ( objects ) , 3 ) #NEWLINE# objects = Model2A . objects . filter ( instance_of = Model2B ) #NEWLINE# self . assertEqual ( repr ( objects [ 0 ] ) , '<Model2B: id 2, field1 (CharField), field2 (CharField)>' ) #NEWLINE# self . assertEqual ( repr ( objects [ 1 ] ) , '<Model2C: id 3, field1 (CharField), field2 (CharField), field3 (CharField)>' ) #NEWLINE# self . assertEqual ( repr ( objects [ 2 ] ) , '<Model2D: id 4, field1 (CharField), field2 (CharField), field3 (CharField), field4 (CharField)>' ) #NEWLINE# self . assertEqual ( len ( objects ) , 3 ) #NEWLINE# objects = Model2A . objects . filter ( Q ( instance_of = Model2B ) ) #NEWLINE# self . assertEqual ( repr ( objects [ 0 ] ) , '<Model2B: id 2, field1 (CharField), field2 (CharField)>' ) #NEWLINE# self . assertEqual ( repr ( objects [ 1 ] ) , '<Model2C: id 3, field1 (CharField), field2 (CharField), field3 (CharField)>' ) #NEWLINE# self . assertEqual ( repr ( objects [ 2 ] ) , '<Model2D: id 4, field1 (CharField), field2 (CharField), field3 (CharField), field4 (CharField)>' ) #NEWLINE# self . assertEqual ( len ( objects ) , 3 ) #NEWLINE# objects = Model2A . objects . not_instance_of ( Model2B ) #NEWLINE# self . assertEqual ( repr ( objects [ 0 ] ) , '<Model2A: id 1, field1 (CharField)>' ) #NEWLINE# self . assertEqual ( len ( objects ) , 1 )