#NEWLINE# def test_polymorph_field_ambiguous_mapping( self ) : #NEWLINE# #INDENT# parent = self . api . model ( 'Parent' , { #NEWLINE# #INDENT# 'name' : fields . String , #NEWLINE# #UNINDENT# } ) #NEWLINE# child = self . api . inherit ( 'Child' , parent , { #NEWLINE# #INDENT# 'extra' : fields . String , #NEWLINE# #UNINDENT# } ) #NEWLINE# class Parent ( object ) : #NEWLINE# #INDENT# name = 'parent' #NEWLINE# #UNINDENT# class Child ( Parent ) : #NEWLINE# #INDENT# extra = 'extra' #NEWLINE# #UNINDENT# mapping = { #NEWLINE# #INDENT# Parent : parent , #NEWLINE# Child : child , #NEWLINE# #UNINDENT# } #NEWLINE# thing = self . api . model ( 'Thing' , { #NEWLINE# #INDENT# 'owner' : fields . Polymorph ( mapping ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# with assert_raises ( ValueError ) : #NEWLINE# #INDENT# self . api . marshal ( { #NEWLINE# #INDENT# 'owner' : Child ( ) , #NEWLINE# #UNINDENT# } , thing )