From c3d8d2d24035a45046c70732dd5f3e6010ac3193 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sun, 29 Oct 2023 18:54:13 +0000 Subject: [PATCH] change datetime --- api/tacticalrmm/alerts/tests.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/api/tacticalrmm/alerts/tests.py b/api/tacticalrmm/alerts/tests.py index 4ca21ac4..41bb5c6d 100644 --- a/api/tacticalrmm/alerts/tests.py +++ b/api/tacticalrmm/alerts/tests.py @@ -1,4 +1,4 @@ -from datetime import datetime, timedelta +from datetime import timedelta from itertools import cycle from unittest.mock import patch @@ -39,14 +39,14 @@ class TestAlertsViews(TacticalTestCase): alerts = baker.make( "alerts.Alert", agent=agent, - alert_time=seq(datetime.now(), timedelta(days=15)), + alert_time=seq(djangotime.now(), timedelta(days=15)), severity=AlertSeverity.WARNING, _quantity=3, ) baker.make( "alerts.Alert", assigned_check=check, - alert_time=seq(datetime.now(), timedelta(days=15)), + alert_time=seq(djangotime.now(), timedelta(days=15)), severity=AlertSeverity.ERROR, _quantity=7, ) @@ -55,7 +55,7 @@ class TestAlertsViews(TacticalTestCase): assigned_task=task, snoozed=True, snooze_until=djangotime.now(), - alert_time=seq(datetime.now(), timedelta(days=15)), + alert_time=seq(djangotime.now(), timedelta(days=15)), _quantity=2, ) baker.make( @@ -63,7 +63,7 @@ class TestAlertsViews(TacticalTestCase): agent=agent, resolved=True, resolved_on=djangotime.now(), - alert_time=seq(datetime.now(), timedelta(days=15)), + alert_time=seq(djangotime.now(), timedelta(days=15)), _quantity=9, ) @@ -126,7 +126,7 @@ class TestAlertsViews(TacticalTestCase): agent = baker.make_recipe("agents.agent") data = { - "alert_time": datetime.now(), + "alert_time": djangotime.now(), "agent": agent.id, "severity": "warning", "alert_type": "availability", @@ -363,7 +363,7 @@ class TestAlertTasks(TacticalTestCase): not_snoozed = baker.make( "alerts.Alert", snoozed=True, - snooze_until=seq(datetime.now(), timedelta(days=15)), + snooze_until=seq(djangotime.now(), timedelta(days=15)), _quantity=5, ) @@ -371,7 +371,7 @@ class TestAlertTasks(TacticalTestCase): snoozed = baker.make( "alerts.Alert", snoozed=True, - snooze_until=seq(datetime.now(), timedelta(days=-15)), + snooze_until=seq(djangotime.now(), timedelta(days=-15)), _quantity=5, )