def test_constrain_construction_dates(self):
    with self.assertRaises(ValueError) as e:
        self.calendar_class(T('1998-12-31'), T('2005-01-01'))
    self.assertEqual(str(e.exception), 'The XSHG holidays are only recorded back to 1999, cannot instantiate the XSHG calendar back to 1998.')
    with self.assertRaises(ValueError) as e:
        self.calendar_class(T('2005-01-01'), T('2026-01-01'))
    self.assertEqual(str(e.exception), 'The XSHG holidays are only recorded to 2025, cannot instantiate the XSHG calendar for 2026.')
def test_constrain_construction_dates(self):
    with self.assertRaises(ValueError) as e:
        self.calendar_class(T('1998-12-31'), T('2005-01-01'))
    self.assertEqual(str(e.exception), 'The XSHG holidays are only recorded back to 1999, cannot instantiate the XSHG calendar back to 1998.')
    with self.assertRaises(ValueError) as e:
        self.calendar_class(T('2005-01-01'), T('2026-01-01'))
    self.assertEqual(str(e.exception), 'The XSHG holidays are only recorded to 2025, cannot instantiate the XSHG calendar for 2026.')