#NEWLINE# def test_prep_bulk_documents_no_type( self ) : #NEWLINE# #INDENT# obj = es . ES ( 'Foo' , 'foondex' ) #NEWLINE# docs = [ { #NEWLINE# #INDENT# '_pk' : 'story2' , #NEWLINE# #UNINDENT# } ] #NEWLINE# prepared = obj . prep_bulk_documents ( 'myaction' , docs ) #NEWLINE# assert ( len ( prepared ) == 1 ) #NEWLINE# doc2 = prepared [ 0 ] #NEWLINE# assert ( sorted ( doc2 . keys ( ) ) == sorted ( [ '_op_type' , '_type' , '_id' , '_index' , '_source' ] ) ) #NEWLINE# assert ( self [ '_source' ] == { #NEWLINE# #INDENT# '_pk' : 'story2' , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( doc2 [ '_op_type' ] == 'myaction' ) #NEWLINE# assert ( doc2 [ '_index' ] == 'foondex' ) #NEWLINE# assert ( doc2 [ '_type' ] == 'Foo' ) #NEWLINE# assert ( doc2 [ '_id' ] == 'story2' )