'Check TradingCalendar Thanksgiving dates.'

def test_thanksgiving(self):

    start_session_label = pd.Timestamp('2005-01-01', tz='UTC')
    end_session_label = pd.Timestamp('2012-12-31', tz='UTC')
    sessions = self.calendar.sessions_in_range(start_session_label, end_session_label)
    thanksgiving_with_four_weeks = pd.Timestamp('2005-11-24', tz='UTC')
    self.assertNotIn(thanksgiving_with_four_weeks, sessions, '\n    If    Nov    has    4    Thursdays,    {0}    Thanksgiving    is    the    last    Thursday.\n    '.strip().format(thanksgiving_with_four_weeks))
    thanksgiving_with_five_weeks = pd.Timestamp('2006-11-23', tz='UTC')
    self.assertNotIn(thanksgiving_with_five_weeks, sessions, '\n    If    Nov    has    5    Thursdays,    {0}    Thanksgiving    is    not    the    last    week.\n    '.strip().format(thanksgiving_with_five_weeks))
    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))
