#NEWLINE# def test_deletion_empty_cluster_task_manager( self ) : #NEWLINE# #INDENT# cluster = self . env . create_cluster ( api = True ) #NEWLINE# resp = self . app . delete ( reverse ( 'ClusterHandler' , kwargs = { #NEWLINE# #INDENT# 'obj_id' : cluster [ 'id' ] , #NEWLINE# #UNINDENT# } ) , headers = self . default_headers ) #NEWLINE# self . assertEqual ( 202 , resp . status_code ) #NEWLINE# notification = self . db . query ( models . Notification ) . filter ( ( models . Notification . topic == 'done' ) ) . filter ( ( models . Notification . message == ( "Environment '%s' and all its nodes are deleted" % cluster [ 'name' ] ) ) ) . first ( ) #NEWLINE# self . assertIsNotNone ( notification ) #NEWLINE# tasks = self . db . query ( models . Task ) . all ( ) #NEWLINE# self . assertEqual ( len ( tasks ) , 1 ) #NEWLINE# self . check_cluster_deletion_task ( tasks [ 0 ] )