firefighter-incident 0.0.18__py3-none-any.whl → 0.0.20__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -331,28 +331,26 @@ class TestUpdateStatusModal:
331
331
  trigger_incident_workflow.assert_not_called()
332
332
 
333
333
  @staticmethod
334
- def test_can_close_when_all_conditions_met(mocker: MockerFixture) -> None:
334
+ def test_can_close_when_all_conditions_met(mocker: MockerFixture, priority_factory, environment_factory) -> None:
335
335
  """Test that closing is allowed when all conditions are met for P3+ incidents."""
336
336
  # Create a user first
337
337
  user = UserFactory.build()
338
338
  user.save()
339
339
 
340
+ # Create P3 priority (needs_postmortem=False) and non-PRD environment
341
+ p3_priority = priority_factory(value=3, name="P3", needs_postmortem=False)
342
+ stg_environment = environment_factory(value="STG", name="Staging")
343
+
340
344
  # Create a P3+ incident in MITIGATED status with all conditions met
341
345
  incident = IncidentFactory.build(
342
346
  _status=IncidentStatus.MITIGATED,
343
347
  created_by=user,
348
+ priority=p3_priority,
349
+ environment=stg_environment,
344
350
  )
345
351
  # IMPORTANT: Save the incident so it has an ID for the form to reference
346
352
  incident.save()
347
353
 
348
- # Mock needs_postmortem to return False (P3+ incident)
349
- mocker.patch.object(
350
- type(incident),
351
- "needs_postmortem",
352
- new_callable=PropertyMock,
353
- return_value=False
354
- )
355
-
356
354
  # Mock can_be_closed to return True (all conditions met)
357
355
  mocker.patch.object(
358
356
  type(incident),