#NEWLINE# def test_loaddata( self ) : #NEWLINE# #INDENT# 'Fixtures can load data into models defined in packages' #NEWLINE# management . call_command ( 'loaddata' , 'fixture1.json' , verbosity = 0 ) #NEWLINE# self . assertQuerysetEqual ( Article . objects . all ( ) , [ 'Time to reform copyright' , 'Poker has no place on ESPN' ] , ( lambda a : a . headline ) ) #NEWLINE# management . call_command ( 'loaddata' , 'fixture2.json' , verbosity = 0 ) #NEWLINE# self . assertQuerysetEqual ( Article . objects . all ( ) , [ 'Django conquers world!' , 'Copyright is fine the way it is' , 'Poker has no place on ESPN' ] , ( lambda a : a . headline ) ) #NEWLINE# with warnings . catch_warnings ( record = True ) as w : #NEWLINE# #INDENT# warnings . simplefilter ( 'always' ) #NEWLINE# management . call_command ( 'loaddata' , 'unknown.json' , verbosity = 0 ) #NEWLINE# #UNINDENT# self . assertEqual ( len ( w ) , 1 ) #NEWLINE# self . assertTrue ( w [ 0 ] . message , "No fixture named 'unknown' found." ) #NEWLINE# self . assertQuerysetEqual ( Article . objects . all ( ) , [ 'Django conquers world!' , 'Copyright is fine the way it is' , 'Poker has no place on ESPN' ] , ( lambda a : a . headline ) )