#NEWLINE# def test_set_dispatches_statuses( self ) : #NEWLINE# #INDENT# d = Dispatch ( message_id = 1 ) #NEWLINE# d . save ( ) #NEWLINE# Dispatch . set_dispatches_statuses ( ** { #NEWLINE# #INDENT# 'sent' : [ d ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# d_ = Dispatch . objects . get ( pk = d . id ) #NEWLINE# self . assertEqual ( d_ . dispatch_status , Dispatch . DISPATCH_STATUS_SENT ) #NEWLINE# self . assertEqual ( d_ . retry_count , 1 ) #NEWLINE# Dispatch . set_dispatches_statuses ( ** { #NEWLINE# #INDENT# 'error' : [ d ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# d_ = Dispatch . objects . get ( pk = d . id ) #NEWLINE# self . assertEqual ( d_ . dispatch_status , Dispatch . DISPATCH_STATUS_ERROR ) #NEWLINE# self . assertEqual ( d_ . retry_count , 2 )