-
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 #2416 from uktrade/uat
PROD Release
- Loading branch information
Showing
71 changed files
with
1,988 additions
and
302 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
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.
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import pytest | ||
from uuid import uuid4 | ||
|
||
from api.applications.libraries.get_applications import get_application | ||
from api.core.exceptions import NotFoundError | ||
from api.applications.tests.factories import StandardApplicationFactory | ||
from api.organisations.tests.factories import OrganisationFactory | ||
|
||
pytestmark = pytest.mark.django_db | ||
|
||
|
||
class TestGetApplication: | ||
|
||
def test_get_application_no_matching_case(self): | ||
with pytest.raises(NotFoundError): | ||
get_application(uuid4()) | ||
|
||
def test_get_application_success(self): | ||
standard_application = StandardApplicationFactory() | ||
assert get_application(standard_application.id) == standard_application | ||
|
||
def test_get_application_with_organisation_success(self): | ||
standard_application = StandardApplicationFactory() | ||
assert ( | ||
get_application(standard_application.id, organisation_id=standard_application.organisation_id) | ||
== standard_application | ||
) | ||
|
||
def test_get_application_with_differing_organisation(self): | ||
standard_application = StandardApplicationFactory() | ||
differing_organisation = OrganisationFactory() | ||
with pytest.raises(NotFoundError): | ||
get_application(standard_application.id, organisation_id=differing_organisation.id) |
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
17 changes: 17 additions & 0 deletions
17
...pplications/migrations/0085_partyonapplication_application_created_a502bc_idx_and_more.py
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Generated by Django 4.2.17 on 2025-02-05 12:48 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("applications", "0084_standardapplication_subject_to_itar_controls"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddIndex( | ||
model_name="partyonapplication", | ||
index=models.Index(fields=["created_at"], name="application_created_a502bc_idx"), # /PS-IGNORE | ||
), | ||
] |
17 changes: 17 additions & 0 deletions
17
api/applications/migrations/0086_goodonapplication_application_created_37e2a2_idx.py
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Generated by Django 4.2.17 on 2025-02-05 14:08 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("applications", "0085_partyonapplication_application_created_a502bc_idx_and_more"), # /PS-IGNORE | ||
] | ||
|
||
operations = [ | ||
migrations.AddIndex( | ||
model_name="goodonapplication", | ||
index=models.Index(fields=["created_at"], name="application_created_37e2a2_idx"), # /PS-IGNORE | ||
), | ||
] |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from api.applications.models import StandardApplication | ||
from api.applications.serializers.standard_application import StandardApplicationViewSerializer | ||
from api.cases.enums import CaseTypeSubTypeEnum | ||
from api.f680.models import F680Application | ||
from api.f680.caseworker.serializers import F680ApplicationSerializer | ||
|
||
|
||
class BaseManifest: | ||
caseworker_serializers = {} | ||
model_class = None | ||
|
||
|
||
class StandardApplicationManifest(BaseManifest): | ||
model_class = StandardApplication | ||
caseworker_serializers = {"view": StandardApplicationViewSerializer} | ||
|
||
|
||
class F680ApplicationManifest(BaseManifest): | ||
model_class = F680Application | ||
caseworker_serializers = {"view": F680ApplicationSerializer} | ||
|
||
|
||
# TODO: Make it so that each application django app defines/registers its own | ||
# manifest, instead of doing it all in this file. Probably using a decorator | ||
class ManifestRegistry: | ||
|
||
def __init__(self): | ||
self.manifests = {} | ||
|
||
def register(self, application_type, manifest): | ||
self.manifests[application_type] = manifest | ||
|
||
def get_manifest(self, application_type): | ||
return self.manifests[application_type] | ||
|
||
|
||
application_manifest_registry = ManifestRegistry() | ||
application_manifest_registry.register(CaseTypeSubTypeEnum.STANDARD, StandardApplicationManifest()) | ||
application_manifest_registry.register(CaseTypeSubTypeEnum.F680, F680ApplicationManifest()) |
Oops, something went wrong.