#NEWLINE# def test_get_last_success_run( self ) : #NEWLINE# #INDENT# objects . Transaction . create ( { #NEWLINE# #INDENT# 'cluster_id' : self . cluster . id , #NEWLINE# 'name' : consts . TASK_NAMES . deployment , #NEWLINE# 'status' : consts . TASK_STATUSES . pending , #NEWLINE# #UNINDENT# } ) #NEWLINE# objects . Transaction . create ( { #NEWLINE# #INDENT# 'cluster_id' : self . cluster . id , #NEWLINE# 'name' : consts . TASK_NAMES . deployment , #NEWLINE# 'status' : consts . TASK_STATUSES . error , #NEWLINE# #UNINDENT# } ) #NEWLINE# transaction = objects . TransactionCollection . get_last_succeed_run ( self . cluster ) #NEWLINE# self . assertIsNone ( transaction ) #NEWLINE# objects . Transaction . create ( { #NEWLINE# #INDENT# 'cluster_id' : self . cluster . id , #NEWLINE# 'name' : consts . TASK_NAMES . deployment , #NEWLINE# 'status' : consts . TASK_STATUSES . ready , #NEWLINE# #UNINDENT# } ) #NEWLINE# finished2 = objects . Transaction . create ( { #NEWLINE# #INDENT# 'cluster_id' : self . cluster . id , #NEWLINE# 'name' : consts . TASK_NAMES . deployment , #NEWLINE# 'status' : consts . TASK_STATUSES . ready , #NEWLINE# #UNINDENT# } ) #NEWLINE# transaction = objects . TransactionCollection . get_last_succeed_run ( self . cluster ) #NEWLINE# self . assertEqual ( finished2 . id , transaction . id )