#NEWLINE# def test_embedded_document_list( self ) : #NEWLINE# #INDENT# '\n        Test with embedded document.\n        ' #NEWLINE# class TestDocument ( self . TestDocument ) : #NEWLINE# #INDENT# embedded_doc = fields . EmbeddedDocumentField ( self . TestEmbeddedDocument ) #NEWLINE# #UNINDENT# self . setup_test_view ( TestDocument ) #NEWLINE# test_obj = TestDocument ( username = 'foo' , name = 'bar' , embedded_doc = self . TestEmbeddedDocument ( body = 'embedded1' ) ) #NEWLINE# test_obj . save ( ) #NEWLINE# with self . app . test_request_context ( ) : #NEWLINE# #INDENT# response = self . client . get ( url_for ( 'test' , user = 'foo' ) ) #NEWLINE# #UNINDENT# self . assertEqual ( { #NEWLINE# #INDENT# 'id' : unicode ( self . id ) , #NEWLINE# 'username' : 'foo' , #NEWLINE# 'name' : 'bar' , #NEWLINE# 'embedded_doc' : { #NEWLINE# #INDENT# 'body' : 'embedded1' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , json . loads ( response . data ) )