Skip to content

Commit

Permalink
Merge pull request #786 from uktrade/LTD-1055-match-system-flags
Browse files Browse the repository at this point in the history
[LTD-1055] Match system flags
  • Loading branch information
alixedi authored Jul 27, 2021
2 parents e3085ce + 86738c9 commit a17f8a6
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/applications/tests/test_edit_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ def test_edit_exhibition_first_exhibition_date_draft_success(self):
data = {
"title": self.application.title,
"required_by_date": self.application.required_by_date,
"first_exhibition_date": "2022-05-03",
"first_exhibition_date": "2030-08-03",
}

response = self.client.post(self.exhibition_url, data=data, **self.exporter_headers)
Expand Down
49 changes: 49 additions & 0 deletions api/flags/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,30 @@ class SystemFlags:
WMD_END_USE_ID = "00000000-0000-0000-0000-000000000006"
FIREARMS_ID = "00000000-0000-0000-0000-000000000007"
MARITIME_ANTI_PIRACY_ID = "00000000-0000-0000-0000-000000000008"
CRYPTOGRAPHIC_ID = "00000000-0000-0000-0000-000000000009"
MEDIA_ID = "00000000-0000-0000-0000-000000000010"
CONTINENTAL_ID = "00000000-0000-0000-0000-000000000011"
DEALER_ID = "00000000-0000-0000-0000-000000000012"
REFUSAL_FLAG_ID_2 = "00000000-0000-0000-0000-000000000013"
ENFORCEMENT_CHECK_REQUIRED = "00000000-0000-0000-0000-000000000014"
NUCLEAR_ID = "00000000-0000-0000-0000-000000000015"
NAVY_ID = "00000000-0000-0000-0000-000000000016"
ARMY_ID = "00000000-0000-0000-0000-000000000017"
AIRFORCE_ID = "00000000-0000-0000-0000-000000000018"
POLICE_ID = "00000000-0000-0000-0000-000000000019"
MINISTRY_OF_INTERIOR_ID = "00000000-0000-0000-0000-000000000020"
OTHER_SECURITY_FORCES_ID = "00000000-0000-0000-0000-000000000021"
COMPANIES_REQUESTING_NUCL_ID = "00000000-0000-0000-0000-000000000022"
MARITIME_ANTI_PIRACY_ID_2 = "00000000-0000-0000-0000-000000000023"
AIRCRAFT_MANUFACTURERS_ID = "00000000-0000-0000-0000-000000000024"
REGISTERED_FIREARM_DEALER_ID = "00000000-0000-0000-0000-000000000025"
OIL_AND_GAS_ID = "00000000-0000-0000-0000-000000000026"
PHARMACEUTICAL_OR_MEDICAL_ID = "00000000-0000-0000-0000-000000000027"
MEDIA_OR_CONTRACT_ID = "00000000-0000-0000-0000-000000000028"
PRIVATE_MILITARY_ID = "00000000-0000-0000-0000-000000000029"
EDUCATION_ID = "00000000-0000-0000-0000-000000000030"
EXPORTERS_OWN_USE_ID = "00000000-0000-0000-0000-000000000031"
OTHER_CONTRACT_ID = "00000000-0000-0000-0000-000000000032"
ENFORCEMENT_END_USER_MATCH = "00000000-0000-0000-0000-000000000033"
ENFORCEMENT_CONSIGNEE_MATCH = "00000000-0000-0000-0000-000000000034"
ENFORCEMENT_ULTIMATE_END_USER_MATCH = "00000000-0000-0000-0000-000000000035"
Expand All @@ -99,11 +122,37 @@ class SystemFlags:
WMD_END_USE_ID,
FIREARMS_ID,
MARITIME_ANTI_PIRACY_ID,
CRYPTOGRAPHIC_ID,
MEDIA_ID,
CONTINENTAL_ID,
DEALER_ID,
REFUSAL_FLAG_ID_2,
ENFORCEMENT_CHECK_REQUIRED,
NUCLEAR_ID,
NAVY_ID,
ARMY_ID,
AIRFORCE_ID,
POLICE_ID,
MINISTRY_OF_INTERIOR_ID,
OTHER_SECURITY_FORCES_ID,
COMPANIES_REQUESTING_NUCL_ID,
MARITIME_ANTI_PIRACY_ID_2,
AIRCRAFT_MANUFACTURERS_ID,
REGISTERED_FIREARM_DEALER_ID,
OIL_AND_GAS_ID,
PHARMACEUTICAL_OR_MEDICAL_ID,
MEDIA_OR_CONTRACT_ID,
PRIVATE_MILITARY_ID,
EDUCATION_ID,
EXPORTERS_OWN_USE_ID,
OTHER_CONTRACT_ID,
ENFORCEMENT_END_USER_MATCH,
ENFORCEMENT_CONSIGNEE_MATCH,
ENFORCEMENT_ULTIMATE_END_USER_MATCH,
ENFORCEMENT_THIRD_PARTY_MATCH,
ENFORCEMENT_SITE_MATCH,
ENFORCEMENT_ORGANISATION_MATCH,
SANCTION_UN_SC_MATCH,
SANCTION_OFSI_MATCH,
SANCTION_UK_MATCH,
]
1 change: 1 addition & 0 deletions api/staticdata/management/commands/seedflags.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ class Command(SeedCommand):
@transaction.atomic
def operation(self, *args, **options):
csv = self.read_csv(FLAGS_FILE)
self.delete_unused_objects(Flag, csv)
self.update_or_create(Flag, csv)
4 changes: 2 additions & 2 deletions test_helpers/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,8 +742,8 @@ def create_mod_clearance_application(

if case_type == CaseTypeEnum.EXHIBITION:
application.title = "title"
application.required_by_date = "2021-07-20"
application.first_exhibition_date = "2022-08-19"
application.required_by_date = "2030-07-20"
application.first_exhibition_date = "2030-07-20"
application.save()
# must be refreshed to return data in same format as database call
application.refresh_from_db()
Expand Down

0 comments on commit a17f8a6

Please sign in to comment.