#NEWLINE# def test_loading_and_validation_and_deletion_of_demo_collections( self ) : #NEWLINE# #INDENT# 'Test loading, validation and deletion of the demo collections.' #NEWLINE# self . assertEqual ( collection_models . CollectionModel . get_collection_count ( ) , 0 ) #NEWLINE# self . assertGreaterEqual ( len ( feconf . DEMO_COLLECTIONS ) , 1 , msg = 'There must be at least one demo collection.' ) #NEWLINE# for collection_id in feconf . DEMO_COLLECTIONS : #NEWLINE# #INDENT# start_time = datetime . datetime . utcnow ( ) #NEWLINE# collection_services . load_demo ( collection_id ) #NEWLINE# collection = collection_services . get_collection_by_id ( collection_id ) #NEWLINE# collection . validate ( ) #NEWLINE# duration = ( datetime . datetime . utcnow ( ) - start_time ) #NEWLINE# processing_time = ( duration . seconds + ( duration . microseconds / 1000000.0 ) ) #NEWLINE# self . log_line ( ( 'Loaded and validated collection %s (%.2f seconds)' % ( collection . title . encode ( 'utf-8' ) , processing_time ) ) ) #NEWLINE# #UNINDENT# self . assertEqual ( collection_models . CollectionModel . get_collection_count ( ) , len ( feconf . DEMO_COLLECTIONS ) ) #NEWLINE# for collection_id in feconf . DEMO_COLLECTIONS : #NEWLINE# #INDENT# collection_services . delete_demo ( collection_id ) #NEWLINE# #UNINDENT# self . assertEqual ( collection_models . CollectionModel . get_collection_count ( ) , 0 )