]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Add a unit test for locale.format_day 1207/head
authorLee Kyoung chan <leekchan@gmail.com>
Wed, 24 Sep 2014 12:37:37 +0000 (21:37 +0900)
committerLee Kyoung chan <leekchan@gmail.com>
Wed, 24 Sep 2014 12:37:37 +0000 (21:37 +0900)
tornado/test/locale_test.py

index 144d766186c037713ed64d49753dfc1bc9b6645a..d12ad52ffa810e7d809b53c71bb94a399eeba4e3 100644 (file)
@@ -91,3 +91,9 @@ class EnglishTest(unittest.TestCase):
         self.assertEqual(locale.list(['A']), 'A')
         self.assertEqual(locale.list(['A', 'B']), 'A and B')
         self.assertEqual(locale.list(['A', 'B', 'C']), 'A, B and C')
+
+    def test_format_day(self):
+        locale = tornado.locale.get('en_US')
+        date = datetime.datetime(2013, 4, 28, 18, 35)
+        self.assertEqual(locale.format_day(date=date, dow=True), 'Sunday, April 28')
+        self.assertEqual(locale.format_day(date=date, dow=False), 'April 28')