def test_set_next_notification_date(self, now_mock):
""" Notifications: Test if next notification date is set """
now_mock.return_value = timezone.make_aware(
timezone.datetime(2016, 11, 16))
now = timezone.localtime(timezone.now())
tomorrow = (timezone.localtime(timezone.now()) +
timezone.timedelta(hours=24)).date()
settings = NotificationSetting.get_solo()
settings.next_notification = now
settings.save()
dsmr_notification.services.set_next_notification(settings, now)
self.assertEqual(settings.next_notification, tomorrow)
评论列表
文章目录