|
31 | 31 | from ietf.group.models import Group |
32 | 32 | from ietf.liaisons.mails import send_sdo_reminder, possibly_send_deadline_reminder |
33 | 33 | from ietf.liaisons.views import contacts_from_roles, contact_email_from_role |
| 34 | +from ietf.utils.timezone import date_today, DEADLINE_TZINFO |
| 35 | + |
34 | 36 |
|
35 | 37 | # ------------------------------------------------- |
36 | 38 | # Helper Functions |
@@ -244,7 +246,7 @@ class ManagementCommandTests(TestCase): |
244 | 246 | def test_check_liaison_deadlines(self): |
245 | 247 | from django.core.management import call_command |
246 | 248 |
|
247 | | - LiaisonStatementFactory(deadline=datetime.date.today()+datetime.timedelta(days=1)) |
| 249 | + LiaisonStatementFactory(deadline=date_today(DEADLINE_TZINFO)+datetime.timedelta(days=1)) |
248 | 250 |
|
249 | 251 | out = io.StringIO() |
250 | 252 | mailbox_before = len(outbox) |
@@ -312,7 +314,7 @@ def test_add_comment(self): |
312 | 314 | self.assertNotContains(r, 'Private comment') |
313 | 315 |
|
314 | 316 | def test_taken_care_of(self): |
315 | | - liaison = LiaisonStatementFactory(deadline=datetime.date.today()+datetime.timedelta(days=1)) |
| 317 | + liaison = LiaisonStatementFactory(deadline=date_today(DEADLINE_TZINFO)+datetime.timedelta(days=1)) |
316 | 318 |
|
317 | 319 | url = urlreverse('ietf.liaisons.views.liaison_detail', kwargs=dict(object_id=liaison.pk)) |
318 | 320 | # normal get |
@@ -386,7 +388,7 @@ def test_approval_process(self): |
386 | 388 | self.assertTrue(liaison.liaisonstatementevent_set.filter(type='posted')) |
387 | 389 |
|
388 | 390 | def test_edit_liaison(self): |
389 | | - liaison = LiaisonStatementFactory(deadline=datetime.date.today()+datetime.timedelta(days=1)) |
| 391 | + liaison = LiaisonStatementFactory(deadline=date_today(DEADLINE_TZINFO) + datetime.timedelta(days=1)) |
390 | 392 | LiaisonStatementEventFactory(statement=liaison,type_id='submitted', time=timezone.now()-datetime.timedelta(days=1)) |
391 | 393 | LiaisonStatementEventFactory(statement=liaison,type_id='posted') |
392 | 394 | from_group = liaison.from_groups.first() |
@@ -698,7 +700,7 @@ def test_add_incoming_liaison(self): |
698 | 700 | from_groups = [ str(g.pk) for g in Group.objects.filter(type="sdo") ] |
699 | 701 | to_group = Group.objects.get(acronym="mars") |
700 | 702 | submitter = Person.objects.get(user__username="marschairman") |
701 | | - today = datetime.date.today() |
| 703 | + today = date_today() |
702 | 704 | related_liaison = liaison |
703 | 705 | r = self.client.post(url, |
704 | 706 | dict(from_groups=from_groups, |
@@ -777,7 +779,7 @@ def test_add_outgoing_liaison(self): |
777 | 779 | from_group = Group.objects.get(acronym="mars") |
778 | 780 | to_group = Group.objects.filter(type="sdo")[0] |
779 | 781 | submitter = Person.objects.get(user__username="marschairman") |
780 | | - today = datetime.date.today() |
| 782 | + today = date_today() |
781 | 783 | related_liaison = liaison |
782 | 784 | r = self.client.post(url, |
783 | 785 | dict(from_groups=str(from_group.pk), |
@@ -845,7 +847,7 @@ def test_add_outgoing_liaison_unapproved_post_only(self): |
845 | 847 | from_group = Group.objects.get(acronym="mars") |
846 | 848 | to_group = Group.objects.filter(type="sdo")[0] |
847 | 849 | submitter = Person.objects.get(user__username="marschairman") |
848 | | - today = datetime.date.today() |
| 850 | + today = date_today() |
849 | 851 | r = self.client.post(url, |
850 | 852 | dict(from_groups=str(from_group.pk), |
851 | 853 | from_contact=submitter.email_address(), |
@@ -1150,7 +1152,7 @@ def test_send_sdo_reminder(self): |
1150 | 1152 | self.assertTrue('ulm-liaiman@' in outbox[-1]['To']) |
1151 | 1153 |
|
1152 | 1154 | def test_send_liaison_deadline_reminder(self): |
1153 | | - liaison = LiaisonStatementFactory(deadline=datetime.date.today()+datetime.timedelta(days=1)) |
| 1155 | + liaison = LiaisonStatementFactory(deadline=date_today(DEADLINE_TZINFO) + datetime.timedelta(days=1)) |
1154 | 1156 |
|
1155 | 1157 | mailbox_before = len(outbox) |
1156 | 1158 | possibly_send_deadline_reminder(liaison) |
|
0 commit comments