Skip to content

Commit

Permalink
fix test problem
Browse files Browse the repository at this point in the history
  • Loading branch information
hmpf committed Nov 15, 2024
1 parent bca5d2f commit d6468ba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/incident/test_incident.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from datetime import timedelta
from datetime import timedelta, datetime

from django.test import TestCase
from django.utils import timezone
Expand Down Expand Up @@ -116,8 +116,8 @@ def test_stateless_event_on_stateful_incident_should_fix_end_time(self):
def test_closing_event_without_finite_end_time_and_reopen_event_should_fix_endt_time(self):

Check warning on line 116 in tests/incident/test_incident.py

View workflow job for this annotation

GitHub Actions / Test results

All 4 runs failed: test_closing_event_without_finite_end_time_and_reopen_event_should_fix_endt_time (tests.incident.test_incident.IncidentRepairEndTimeTests)

artifacts/test-reports-3.10/py310-django42/test-results.xml [took 0s] artifacts/test-reports-3.11/py311-django42/test-results.xml [took 0s] artifacts/test-reports-3.12/py312-django42/test-results.xml [took 0s] artifacts/test-reports-3.9/py39-django42/test-results.xml [took 0s]
Raw output
datet[28 chars]3, 59, 59, 999999, tzinfo=zoneinfo.ZoneInfo(key='Europe/Oslo')) != datet[28 chars]3, 59, 59, 999999)
Traceback (most recent call last):
  File "/home/runner/work/Argus/Argus/tests/incident/test_incident.py", line 119, in test_closing_event_without_finite_end_time_and_reopen_event_should_fix_endt_time
    self.assertEqual(incident.end_time, datetime.max)
AssertionError: datet[28 chars]3, 59, 59, 999999, tzinfo=zoneinfo.ZoneInfo(key='Europe/Oslo')) != datet[28 chars]3, 59, 59, 999999)
incident = StatefulIncidentFactory(level=1)
end_time = incident.end_time
self.assertEqual(incident.end_time, INFINITY_REPR)
self.assertEqual(incident.end_time, datetime.max)
EventFactory(incident=incident, type=Event.Type.INCIDENT_END)
self.asserTrue(incident.repair_end_time())
self.assertNotEqual(end_time, incident.end_time)
self.assertLessThan(incident.end_time, INFINITY_REPR)
self.assertLessThan(incident.end_time, datetime.max)

0 comments on commit d6468ba

Please sign in to comment.