'Test that can_trade returns False for an asset after its auto close
date.'

def test_can_trade_delisted(self):

    auto_closing_asset = self.asset_finder.retrieve_asset(7)
    minutes_to_check = [(pd.Timestamp('2016-01-20    00:00:00', tz='UTC'), True), (pd.Timestamp('2016-01-20    23:00:00', tz='UTC'), True), (pd.Timestamp('2016-01-20    23:01:00', tz='UTC'), False), (pd.Timestamp('2016-01-20    23:59:00', tz='UTC'), False), (pd.Timestamp('2016-01-21    00:00:00', tz='UTC'), False), (pd.Timestamp('2016-01-21    00:01:00', tz='UTC'), False), (pd.Timestamp('2016-01-22    00:00:00', tz='UTC'), False)]
    for info in minutes_to_check:
        bar_data = self.create_bardata(simulation_dt_func=(lambda : info[0]))
        self.assertEqual(bar_data.can_trade(auto_closing_asset), info[1])
