'Check whether the TradingCalendar contains certain dates.'

def test_new_years(self):

    start_session = pd.Timestamp('2012-01-02', tz='UTC')
    end_session = pd.Timestamp('2013-12-31', tz='UTC')
    sessions = self.calendar.sessions_in_range(start_session, end_session)
    day_after_new_years_sunday = pd.Timestamp('2012-01-02', tz='UTC')
    self.assertNotIn(day_after_new_years_sunday, sessions, '\n    If    NYE    falls    on    a    weekend,    {0}    the    Monday    after    is    a    holiday.\n    '.strip().format(day_after_new_years_sunday))
    first_trading_day_after_new_years_sunday = pd.Timestamp('2012-01-03', tz='UTC')
    self.assertIn(first_trading_day_after_new_years_sunday, sessions, '\n    If    NYE    falls    on    a    weekend,    {0}    the    Tuesday    after    is    the    first    trading    day.\n    '.strip().format(first_trading_day_after_new_years_sunday))
    new_years_day = pd.Timestamp('2013-01-01', tz='UTC')
    self.assertNotIn(new_years_day, sessions, '\n    If    NYE    falls    during    the    week,    e.g.    {0},    it    is    a    holiday.\n    '.strip().format(new_years_day))
    first_trading_day_after_new_years = pd.Timestamp('2013-01-02', tz='UTC')
    self.assertIn(first_trading_day_after_new_years, sessions, '\n    If    the    day    after    NYE    falls    during    the    week,    {0}        is    the    first    trading    day.\n    '.strip().format(first_trading_day_after_new_years))
