Skip to content

Commit

Permalink
fix: test no block
Browse files Browse the repository at this point in the history
  • Loading branch information
GabDug committed Jan 9, 2024
1 parent f6ee11f commit daf1d10
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/test_slack/views/modals/test_update_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
from unittest.mock import MagicMock

import pytest
from django.conf import settings
from pytest_mock import MockerFixture

from firefighter.incidents.factories import IncidentFactory, UserFactory
from firefighter.incidents.models import Incident
from firefighter.slack.views import UpdateStatusModal

logger = logging.getLogger(__name__)
SLACK_SEVERITY_HELP_GUIDE_URL = settings.SLACK_SEVERITY_HELP_GUIDE_URL


@pytest.mark.django_db()
Expand All @@ -32,7 +34,9 @@ def test_update_status_modal_build(incident: Incident) -> None:

values = res.to_dict()
assert "blocks" in values
assert len(values["blocks"]) == 7
# If link, to doc, additionnal block
blocks_count = 7 if SLACK_SEVERITY_HELP_GUIDE_URL else 6
assert len(values["blocks"]) == blocks_count

@staticmethod
def test_submit_empty_bodied_form(incident: Incident) -> None:
Expand Down

0 comments on commit daf1d10

Please sign in to comment.