#NEWLINE# def test_async_apply_expires_datetime( self ) : #NEWLINE# #INDENT# task = self . _app . capp . tasks [ 'foo' ] = Mock ( ) #NEWLINE# task . apply_async = Mock ( return_value = AsyncResult ( 123 ) ) #NEWLINE# tomorrow = ( datetime . utcnow ( ) + timedelta ( days = 1 ) ) #NEWLINE# r = self . post ( '/api/task/async-apply/foo' , body = ( '{"expires": "%s"}' % tomorrow ) ) #NEWLINE# self . assertEqual ( 200 , r . code ) #NEWLINE# task . apply_async . assert_called_once_with ( args = [ ] , kwargs = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , expires = tomorrow )