diff --git a/Lib/test/test_calendar.py b/Lib/test/test_calendar.py index 39b47e6fa39ca8..b7cbe740119cad 100644 --- a/Lib/test/test_calendar.py +++ b/Lib/test/test_calendar.py @@ -605,6 +605,16 @@ def test_locale_calendars(self): new_october = calendar.TextCalendar().formatmonthname(2010, 10, 10) self.assertEqual(old_october, new_october) + def test_locale_calendar_formatweekday(self): + # formatweekday uses different day names based on the available width. + cal = calendar.LocaleTextCalendar(locale='en_US') + # For short widths, a centered, abbreviated name is used. + self.assertEqual(cal.formatweekday(0, 5), " Mon ") + # For really short widths, even the abbreviated name is truncated. + self.assertEqual(cal.formatweekday(0, 2), "Mo") + # For long widths, the full day name is used. + self.assertEqual(cal.formatweekday(0, 10), " Monday ") + def test_locale_html_calendar_custom_css_class_month_name(self): try: cal = calendar.LocaleHTMLCalendar(locale='')