#NEWLINE# def test_bad_status_in_production( self ) : #NEWLINE# #INDENT# with open ( settings . WEBPACK_LOADER [ DEFAULT_CONFIG ] [ 'STATS_FILE' ] , 'w' ) as stats_file : #NEWLINE# #INDENT# stats_file . write ( json . dumps ( { #NEWLINE# #INDENT# 'status' : 'unexpected-status' , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# get_loader ( DEFAULT_CONFIG ) . get_bundle ( 'main' ) #NEWLINE# #UNINDENT# except WebpackLoaderBadStatsError as e : #NEWLINE# #INDENT# self . assertIn ( 'The stats file does not contain valid data. Make sure webpack-bundle-tracker plugin is enabled and try to run webpack again.' , str ( self ) )