mirror of https://github.com/snachodog/mybuddy.git
Add test for custom date format
This commit is contained in:
parent
94cb7d771a
commit
16c34ca7f0
|
@ -18,6 +18,7 @@ else:
|
||||||
'%m/%d/%Y %I:%M %p', # '10/25/2006 2:30 PM'
|
'%m/%d/%Y %I:%M %p', # '10/25/2006 2:30 PM'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# Add custom "short" version of `MONTH_DAY_FORMAT`.
|
||||||
SHORT_MONTH_DAY_FORMAT = 'M j'
|
SHORT_MONTH_DAY_FORMAT = 'M j'
|
||||||
|
|
||||||
# Append all other input formats from the base locale.
|
# Append all other input formats from the base locale.
|
||||||
|
|
|
@ -60,3 +60,8 @@ class FormatsTestCase(TestCase):
|
||||||
|
|
||||||
t = datetime.time(hour=16, minute=2, second=25)
|
t = datetime.time(hour=16, minute=2, second=25)
|
||||||
self.assertEqual(time_format(t), '16:02:25')
|
self.assertEqual(time_format(t), '16:02:25')
|
||||||
|
|
||||||
|
def test_short_month_day_format(self):
|
||||||
|
dt = datetime.datetime(year=2021, month=7, day=31, hour=5, minute=5,
|
||||||
|
second=5)
|
||||||
|
self.assertEqual(date_format(dt, 'SHORT_MONTH_DAY_FORMAT'), 'Jul 31')
|
||||||
|
|
Loading…
Reference in New Issue