-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2379 from uktrade/uat
PROD Release
- Loading branch information
Showing
12 changed files
with
148 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -910,7 +910,7 @@ def setUp(self): | |
super().setUp() | ||
|
||
self.other_team = self.create_team("other team") | ||
self.other_team_gov_user = self.create_gov_user("[email protected]", self.other_team) | ||
self.other_team_gov_user = self.create_gov_user("[email protected]", self.other_team) # /PS-IGNORE | ||
self.queue = self.create_queue("my new queue", self.team) | ||
self.case = self.create_standard_application_case(self.organisation) | ||
self.case.queues.set([self.queue]) | ||
|
@@ -1011,7 +1011,7 @@ def test_api_success(self): | |
self._create_data() | ||
self.advice = FinalAdviceFactory(user=self.gov_user, case=self.case, type=AdviceType.APPROVE, good=self.good) | ||
self.gov_user2 = self.create_gov_user( | ||
team=self.create_team(name="other_team"), email="[email protected]" | ||
team=self.create_team(name="other_team"), email="[email protected]" # /PS-IGNORE | ||
) | ||
self.group_advice = FinalAdviceFactory( | ||
user=self.gov_user2, case=self.case, type=AdviceType.REFUSE, good=self.good | ||
|
@@ -1148,12 +1148,33 @@ def test_api_success(self): | |
], | ||
) | ||
|
||
# Reflect rest framework's way of rendering datetime objects... https://github.com/encode/django-rest-framework/blob/c9e7b68a4c1db1ac60e962053380acda549609f3/rest_framework/utils/encoders.py#L29 | ||
# Reflect rest framework's way of rendering datetime objects... https://github.com/encode/django-rest-framework/blob/c9e7b68a4c1db1ac60e962053380acda549609f3/rest_framework/utils/encoders.py#L29 /PS-IGNORE | ||
expected_submitted_at = self.case.submitted_at.isoformat() | ||
if expected_submitted_at.endswith("+00:00"): | ||
expected_submitted_at = expected_submitted_at[:-6] + "Z" | ||
self.assertEqual(case_api_result["submitted_at"], expected_submitted_at) | ||
|
||
def test_api_multiple_cases_flags_correct(self): | ||
# Create two cases.. | ||
self._create_data() | ||
self._create_data() | ||
# Add a case flag to each case.. | ||
flag_alias = "REFER_TO_FCDO_MEUC_CONCERNS" | ||
flag = Flag.objects.get(alias=flag_alias) | ||
all_cases = Case.objects.all() | ||
for case in all_cases: | ||
case.flags.add(flag) | ||
|
||
# Perform the search | ||
response = self.client.get(self.url, **self.gov_headers) | ||
response_data = response.json()["results"] | ||
|
||
self.assertEqual(response.status_code, status.HTTP_200_OK) | ||
self.assertEqual(len(response_data["cases"]), 2) | ||
for search_result in response_data["cases"]: | ||
self.assertEqual(len(search_result["flags"]), 1) | ||
self.assertEqual(search_result["flags"][0]["alias"], flag_alias) | ||
|
||
def test_api_no_advice(self): | ||
self._create_data() | ||
response = self.client.get(self.url, **self.gov_headers) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.