#NEWLINE# def test_bulk_index( self ) : #NEWLINE# #INDENT# documents = [ { #NEWLINE# #INDENT# 'id' : 1 , #NEWLINE# 'name' : 'odin skullcrusher' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'id' : 2 , #NEWLINE# 'name' : 'heimdall kneebiter' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'id' : 3 , #NEWLINE# 'name' : 'erik rose' , #NEWLINE# #UNINDENT# } ] #NEWLINE# for doc in documents : #NEWLINE# #INDENT# FakeModel ( ** doc ) #NEWLINE# #UNINDENT# FakeDjangoMappingType . bulk_index ( documents , id_field = 'id' ) #NEWLINE# self . refresh ( FakeDjangoMappingType . get_index ( ) ) #NEWLINE# eq_ ( len ( S ( FakeDjangoMappingType ) . query ( name__prefix = 'odin' ) ) , 1 ) #NEWLINE# eq_ ( len ( S ( FakeDjangoMappingType ) . query ( name__prefix = 'erik' ) ) , 1 )