#NEWLINE# def test_document_can_be_created_dynamically( ) : #NEWLINE# #INDENT# n = datetime . now ( ) #NEWLINE# md = MyDoc ( title = 'hello' ) #NEWLINE# md . name = 'My Fancy Document!' #NEWLINE# md . created_at = n #NEWLINE# inner = md . inner #NEWLINE# assert ( inner is md . inner ) #NEWLINE# inner . old_field = 'Already defined.' #NEWLINE# md . inner . new_field = [ 'undefined' , 'field' ] #NEWLINE# assert ( { #NEWLINE# #INDENT# 'title' : 'hello' , #NEWLINE# 'name' : 'My Fancy Document!' , #NEWLINE# 'created_at' : n , #NEWLINE# 'inner' : { #NEWLINE# #INDENT# 'old_field' : 'Already defined.' , #NEWLINE# 'new_field' : [ 'undefined' , 'field' ] , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } == md . to_dict ( ) )