#NEWLINE# def test_eager_constraints_are_properly_added( self ) : #NEWLINE# #INDENT# relation = self . _get_relation ( ) #NEWLINE# relation . get_query ( ) . get_query ( ) . should_receive ( 'where_in' ) . once ( ) . with_args ( 'taggables.taggable_id' , [ 1 , 2 ] ) #NEWLINE# relation . get_query ( ) . should_receive ( 'where' ) . once ( ) . with_args ( 'taggables.taggable_type' , relation . get_parent ( ) . __class__ . __name__ ) #NEWLINE# model1 = OrmMorphToManyModelStub ( ) #NEWLINE# model1 . id = 1 #NEWLINE# model2 = OrmMorphToManyModelStub ( ) #NEWLINE# model2 . id = 2 #NEWLINE# relation . add_eager_constraints ( [ model1 , model2 ] )