added created.dd and modified.dd to template system, closes #135

This commit is contained in:
Rhet Turnbull
2020-05-23 21:39:40 -07:00
parent af750dd2e3
commit 28935b0af9
7 changed files with 48 additions and 1 deletions

View File

@@ -0,0 +1,21 @@
""" test datetime_formatter.DateTimeFormatter """
import pytest
def test_datetime_formatter():
import datetime
import locale
from osxphotos.datetime_formatter import DateTimeFormatter
locale.setlocale(locale.LC_ALL, "en_US")
dt = datetime.datetime(2020,5,23)
dtf = DateTimeFormatter(dt)
assert dtf.date == "2020-05-23"
assert dtf.year == "2020"
assert dtf.yy == "20"
assert dtf.month == "May"
assert dtf.mon == "May"
assert dtf.mm == "05"
assert dtf.dd == "23"
assert dtf.doy == "144"