!112 !94: tests commons modules that contains most of the logic + zoneinfo (#113)

!112

Co-authored-by: bkfox <thomas bkfox net>
Reviewed-on: rc/aircox#113
This commit is contained in:
Thomas Kairos
2023-08-23 15:28:17 +02:00
parent f9ad81ddac
commit 2ce435fb5d
22 changed files with 253 additions and 108 deletions

View File

@ -24,7 +24,7 @@ class TestSchedule:
@pytest.mark.django_db
def test_tz(self, schedules):
for schedule in schedules:
assert schedule.timezone == schedule.tz.zone
assert schedule.timezone == schedule.tz.key
@pytest.mark.django_db
def test_start(self, schedules):
@ -45,7 +45,7 @@ class TestSchedule:
def test_normalize(self, schedules):
for schedule in schedules:
dt = datetime.combine(schedule.date, schedule.time)
assert schedule.normalize(dt).tzinfo.zone == schedule.timezone
assert schedule.normalize(dt).tzinfo.key == schedule.timezone
@pytest.mark.django_db
def test_dates_of_month_ponctual(self):
@ -117,7 +117,7 @@ class TestSchedule:
assert dt.month == at.month
assert dt.weekday() == schedule.date.weekday()
assert dt.time() == schedule.time
assert dt.tzinfo.zone == schedule.timezone
assert dt.tzinfo.key == schedule.timezone
@pytest.mark.django_db
def test_diffusions_of_month(self, sched_initials):