#NEWLINE# def test_foreign_field( self ) : #NEWLINE# #INDENT# class TestXMLModel ( XMLModel ) : #NEWLINE# #INDENT# root = XMLRootField ( path = 'person' ) #NEWLINE# model = XMLDjangoModelField ( MyModel , path = 'id' , null = True , nomatch = True ) #NEWLINE# class Meta ( ) : #NEWLINE# #INDENT# dbModel = MyModelWithForeign #NEWLINE# #UNINDENT# #UNINDENT# xmldata = '<data>\n                        <person>\n                            <id>1</id>\n                        </person>\n                        <person>\n                            <id>2</id>\n                        </person>\n\n                     </data>' #NEWLINE# model_object1 = MyModel . objects . create ( nom = 'Gigi' , age = 10 , taille = 1.2 ) #NEWLINE# test = TestXMLModel . import_data ( xmldata ) #NEWLINE# self . assertEquals ( test [ 0 ] . model , self ) #NEWLINE# self . assertEquals ( test [ 1 ] . model , None )