#NEWLINE# def test_to_doc( self ) : #NEWLINE# #INDENT# test_doc = CRITERION1 . to_doc ( ) #NEWLINE# answer_doc = { #NEWLINE# #INDENT# '_metadata' : { #NEWLINE# #INDENT# 'cls' : 'TargetingCriterion' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'OR' : [ { #NEWLINE# #INDENT# '_metadata' : { #NEWLINE# #INDENT# 'cls' : 'AdUnit' , #NEWLINE# #UNINDENT# } , #NEWLINE# 'external_name' : None , #NEWLINE# 'external_id' : None , #NEWLINE# 'id' : '1' , #NEWLINE# 'include_descendants' : True , #NEWLINE# 'name' : 'home' , #NEWLINE# 'parent_id' : None , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertEqual ( test_doc , answer_doc ) #NEWLINE# self . assertEqual ( CRITERION1 , TargetingCriterion . from_doc ( answer_doc ) ) #NEWLINE# self . assertEqual ( CRITERION1 , TargetingCriterion . from_doc ( CRITERION1 . to_doc ( ) ) ) #NEWLINE# self . assertEqual ( CRITERION2 , TargetingCriterion . from_doc ( CRITERION2 . to_doc ( ) ) ) #NEWLINE# self . assertEqual ( CRITERION3 , TargetingCriterion . from_doc ( CRITERION3 . to_doc ( ) ) ) #NEWLINE# self . assertEqual ( CRITERION4 , TargetingCriterion . from_doc ( CRITERION4 . to_doc ( ) ) )