Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
testing approve-all-desnz
Browse files Browse the repository at this point in the history
Tllew committed Nov 21, 2024
1 parent 062c64a commit 6e48010
Showing 2 changed files with 22 additions and 4 deletions.
4 changes: 0 additions & 4 deletions caseworker/advice/conditionals.py
Original file line number Diff line number Diff line change
@@ -9,9 +9,5 @@ def _get_form_field_boolean(wizard):
return _get_form_field_boolean


def FCDO_team(wizard):
return wizard.caseworker["team"]["alias"] == services.FCDO_TEAM


def DESNZ_team(wizard):
return wizard.caseworker["team"]["alias"] in services.DESNZ_TEAMS
22 changes: 22 additions & 0 deletions unit_tests/caseworker/advice/views/test_select_advice_view.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
from unittest import mock
import pytest
from bs4 import BeautifulSoup

from django.urls import reverse

from caseworker.advice import services


@pytest.fixture(autouse=True)
def setup(mock_queue, mock_case):
@@ -26,6 +29,25 @@ def test_select_advice_post(authorized_client, url, recommendation, redirect):
assert redirect in response.url


@mock.patch("caseworker.advice.views.get_gov_user")
def test_select_advice_post_desnz(mock_get_gov_user, authorized_client, url):
mock_get_gov_user.return_value = (
{
"user": {
"team": {
"id": "56273dd4-4634-4ad7-a782-e480f85a85a9",
"name": "DESNZ Chemical",
"alias": services.DESNZ_CHEMICAL,
}
}
},
None,
)
response = authorized_client.post(url, data={"recommendation": "approve_all"})
assert response.status_code == 302
assert "approve-all-desnz" in response.url


def test_view_serial_numbers_for_firearm_product_in_select_advice_view(authorized_client, data_standard_case, url):
good_on_application = data_standard_case["case"]["data"]["goods"][0]
assert good_on_application["firearm_details"]["serial_numbers"][0] == "12345"

0 comments on commit 6e48010

Please sign in to comment.