change datetime

This commit is contained in:
wh1te909 2023-10-29 18:54:13 +00:00
parent c29cf70025
commit c3d8d2d240
1 changed files with 8 additions and 8 deletions

View File

@ -1,4 +1,4 @@
from datetime import datetime, timedelta from datetime import timedelta
from itertools import cycle from itertools import cycle
from unittest.mock import patch from unittest.mock import patch
@ -39,14 +39,14 @@ class TestAlertsViews(TacticalTestCase):
alerts = baker.make( alerts = baker.make(
"alerts.Alert", "alerts.Alert",
agent=agent, agent=agent,
alert_time=seq(datetime.now(), timedelta(days=15)), alert_time=seq(djangotime.now(), timedelta(days=15)),
severity=AlertSeverity.WARNING, severity=AlertSeverity.WARNING,
_quantity=3, _quantity=3,
) )
baker.make( baker.make(
"alerts.Alert", "alerts.Alert",
assigned_check=check, assigned_check=check,
alert_time=seq(datetime.now(), timedelta(days=15)), alert_time=seq(djangotime.now(), timedelta(days=15)),
severity=AlertSeverity.ERROR, severity=AlertSeverity.ERROR,
_quantity=7, _quantity=7,
) )
@ -55,7 +55,7 @@ class TestAlertsViews(TacticalTestCase):
assigned_task=task, assigned_task=task,
snoozed=True, snoozed=True,
snooze_until=djangotime.now(), snooze_until=djangotime.now(),
alert_time=seq(datetime.now(), timedelta(days=15)), alert_time=seq(djangotime.now(), timedelta(days=15)),
_quantity=2, _quantity=2,
) )
baker.make( baker.make(
@ -63,7 +63,7 @@ class TestAlertsViews(TacticalTestCase):
agent=agent, agent=agent,
resolved=True, resolved=True,
resolved_on=djangotime.now(), resolved_on=djangotime.now(),
alert_time=seq(datetime.now(), timedelta(days=15)), alert_time=seq(djangotime.now(), timedelta(days=15)),
_quantity=9, _quantity=9,
) )
@ -126,7 +126,7 @@ class TestAlertsViews(TacticalTestCase):
agent = baker.make_recipe("agents.agent") agent = baker.make_recipe("agents.agent")
data = { data = {
"alert_time": datetime.now(), "alert_time": djangotime.now(),
"agent": agent.id, "agent": agent.id,
"severity": "warning", "severity": "warning",
"alert_type": "availability", "alert_type": "availability",
@ -363,7 +363,7 @@ class TestAlertTasks(TacticalTestCase):
not_snoozed = baker.make( not_snoozed = baker.make(
"alerts.Alert", "alerts.Alert",
snoozed=True, snoozed=True,
snooze_until=seq(datetime.now(), timedelta(days=15)), snooze_until=seq(djangotime.now(), timedelta(days=15)),
_quantity=5, _quantity=5,
) )
@ -371,7 +371,7 @@ class TestAlertTasks(TacticalTestCase):
snoozed = baker.make( snoozed = baker.make(
"alerts.Alert", "alerts.Alert",
snoozed=True, snoozed=True,
snooze_until=seq(datetime.now(), timedelta(days=-15)), snooze_until=seq(djangotime.now(), timedelta(days=-15)),
_quantity=5, _quantity=5,
) )