#NEWLINE# def test_algo_with_rl_violation_cumulative( self ) : #NEWLINE# #INDENT# '\n        Add a new restriction, run a test long after both\n        knowledge dates, make sure stock from original restriction\n        set is still disallowed.\n        ' #NEWLINE# sim_params = factory . create_simulation_parameters ( start = ( list ( LEVERAGED_ETFS . keys ( ) ) [ 0 ] + timedelta ( days = 7 ) ) , num_days = 4 ) #NEWLINE# with security_list_copy ( ) : #NEWLINE# #INDENT# add_security_data ( [ 'AAPL' ] , [ ] ) #NEWLINE# algo = RestrictedAlgoWithoutCheck ( symbol = 'BZQ' , sim_params = sim_params , env = self . env ) #NEWLINE# with self . assertRaises ( TradingControlViolation ) as ctx : #NEWLINE# #INDENT# algo . run ( self . data_portal ) #NEWLINE# #UNINDENT# self . check_algo_exception ( algo , sim_params , 0 )