(self)
| 673 | self.assertGreaterEqual(len(local_month), 10) |
| 674 | |
| 675 | def test_locale_html_calendar(self): |
| 676 | try: |
| 677 | cal = calendar.LocaleHTMLCalendar(locale='') |
| 678 | local_weekday = cal.formatweekday(1) |
| 679 | local_month = cal.formatmonthname(2010, 10) |
| 680 | except locale.Error: |
| 681 | # cannot set the system default locale -- skip rest of test |
| 682 | raise unittest.SkipTest('cannot set the system default locale') |
| 683 | self.assertIsInstance(local_weekday, str) |
| 684 | self.assertIsInstance(local_month, str) |
| 685 | |
| 686 | cal = calendar.LocaleHTMLCalendar(locale=None) |
| 687 | local_weekday = cal.formatweekday(1) |
| 688 | local_month = cal.formatmonthname(2010, 10) |
| 689 | self.assertIsInstance(local_weekday, str) |
| 690 | self.assertIsInstance(local_month, str) |
| 691 | |
| 692 | cal = calendar.LocaleHTMLCalendar(locale='C') |
| 693 | local_weekday = cal.formatweekday(1) |
| 694 | local_month = cal.formatmonthname(2010, 10) |
| 695 | self.assertIsInstance(local_weekday, str) |
| 696 | self.assertIsInstance(local_month, str) |
| 697 | |
| 698 | def test_locale_calendars_reset_locale_properly(self): |
| 699 | # ensure that Locale{Text,HTML}Calendar resets the locale properly |
nothing calls this directly
no test coverage detected