From 9f9cfa6d2b5a30ce2903a594c1cc6fdb5e611e92 Mon Sep 17 00:00:00 2001 From: Kial Jinnah Date: Mon, 29 Jun 2026 13:45:16 -0400 Subject: [PATCH] 33872 API/Filer - apply comment_type Signed-off-by: Kial Jinnah --- legal-api/poetry.lock | 14 +++---- .../v2/business/business_comments.py | 1 + .../resources/v2/business/filing_comments.py | 1 + .../tests/unit/core/test_filing_ledger.py | 1 + legal-api/tests/unit/models/__init__.py | 2 + .../test_filings_ledger.py | 1 + .../unit/resources/v2/test_filing_comments.py | 9 ++++- queue_services/business-filer/poetry.lock | 38 +++++++++---------- .../filing_processors/amalgamation_out.py | 3 +- .../consent_continuation_out.py | 1 + .../filing_processors/continuation_out.py | 1 + .../filing_processors/correction.py | 2 + .../unit/test_filer/test_amalgamation_out.py | 7 ++-- .../test_consent_continuation_out.py | 7 +++- .../unit/test_filer/test_continuation_out.py | 11 ++++-- .../tests/unit/test_filer/test_correction.py | 20 +++++++++- 16 files changed, 81 insertions(+), 38 deletions(-) diff --git a/legal-api/poetry.lock b/legal-api/poetry.lock index 411441b555..eb11c9ec9c 100644 --- a/legal-api/poetry.lock +++ b/legal-api/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.2.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.3.1 and should not be changed by hand. [[package]] name = "aiofiles" @@ -316,7 +316,7 @@ files = [ [[package]] name = "business-model" -version = "3.3.31" +version = "3.3.32" description = "" optional = false python-versions = ">=3.13,<3.14" @@ -343,7 +343,7 @@ sql-versioning = {git = "https://github.com/bcgov/lear.git", rev = "main", subdi type = "git" url = "https://github.com/bcgov/lear.git" reference = "main" -resolved_reference = "a09ecdbac69185ffafa14c5d21e44455ab86fcdb" +resolved_reference = "295ecb7a24620142f1a18af02fb191df4cafcc85" subdirectory = "python/common/business-registry-model" [[package]] @@ -1462,11 +1462,11 @@ files = [ ] [package.dependencies] -google-api-core = ">=1.31.6,<2.0.dev0 || >2.3.0,<3.0.0dev" -google-auth = ">=1.25.0,<3.0dev" +google-api-core = ">=1.31.6,<2.0.dev0 || >2.3.0,<3.0.0.dev0" +google-auth = ">=1.25.0,<3.0.dev0" [package.extras] -grpc = ["grpcio (>=1.38.0,<2.0dev)", "grpcio-status (>=1.38.0,<2.0.dev0)"] +grpc = ["grpcio (>=1.38.0,<2.0.dev0)", "grpcio-status (>=1.38.0,<2.0.dev0)"] [[package]] name = "google-cloud-datastore" @@ -1913,7 +1913,7 @@ fqdn = {version = "*", optional = true, markers = "extra == \"format\""} idna = {version = "*", optional = true, markers = "extra == \"format\""} isoduration = {version = "*", optional = true, markers = "extra == \"format\""} jsonpointer = {version = ">1.13", optional = true, markers = "extra == \"format\""} -jsonschema-specifications = ">=2023.03.6" +jsonschema-specifications = ">=2023.3.6" referencing = ">=0.28.4" rfc3339-validator = {version = "*", optional = true, markers = "extra == \"format\""} rfc3987 = {version = "*", optional = true, markers = "extra == \"format\""} diff --git a/legal-api/src/legal_api/resources/v2/business/business_comments.py b/legal-api/src/legal_api/resources/v2/business/business_comments.py index d766882b82..03aad3a145 100644 --- a/legal-api/src/legal_api/resources/v2/business/business_comments.py +++ b/legal-api/src/legal_api/resources/v2/business/business_comments.py @@ -93,6 +93,7 @@ def post_comments(identifier): try: comment = Comment() comment.comment = json_input["comment"]["comment"] + comment.comment_type = Comment.CommentType.STAFF comment.staff_id = user.id comment.business_id = business.id comment.timestamp = datetime.now(UTC) diff --git a/legal-api/src/legal_api/resources/v2/business/filing_comments.py b/legal-api/src/legal_api/resources/v2/business/filing_comments.py index 558db52fda..3a2a25ff34 100644 --- a/legal-api/src/legal_api/resources/v2/business/filing_comments.py +++ b/legal-api/src/legal_api/resources/v2/business/filing_comments.py @@ -100,6 +100,7 @@ def post_filing_comments(identifier, filing_id): try: comment = Comment() comment.comment = json_input["comment"]["comment"] + comment.comment_type = Comment.CommentType.STAFF comment.staff_id = user.id comment.filing_id = filing_id comment.timestamp = datetime.now(UTC) diff --git a/legal-api/tests/unit/core/test_filing_ledger.py b/legal-api/tests/unit/core/test_filing_ledger.py index 17049d7499..6c4830245c 100644 --- a/legal-api/tests/unit/core/test_filing_ledger.py +++ b/legal-api/tests/unit/core/test_filing_ledger.py @@ -58,6 +58,7 @@ def load_ledger(business, founding_date): for c in range(i): comment = Comment() comment.comment = f'this comment {c}' + comment.comment_type = Comment.CommentType.STAFF f.comments.append(comment) f.save() i += 1 diff --git a/legal-api/tests/unit/models/__init__.py b/legal-api/tests/unit/models/__init__.py index 33cf371cea..c39fd60b10 100644 --- a/legal-api/tests/unit/models/__init__.py +++ b/legal-api/tests/unit/models/__init__.py @@ -360,6 +360,7 @@ def factory_business_comment(business: Business = None, comment_text: str = 'som c = Comment() c.business_id = business.id + c.comment_type = Comment.CommentType.STAFF c.timestamp = EPOCH_DATETIME c.comment = comment_text if user: @@ -382,6 +383,7 @@ def factory_comment( c.filing_id = filing.id c.timestamp = EPOCH_DATETIME c.comment = comment_text + c.comment_type = Comment.CommentType.STAFF if user: c.staff_id = user.id c.save() diff --git a/legal-api/tests/unit/resources/v2/test_business_filings/test_filings_ledger.py b/legal-api/tests/unit/resources/v2/test_business_filings/test_filings_ledger.py index 91a9377cb0..af1c094b75 100644 --- a/legal-api/tests/unit/resources/v2/test_business_filings/test_filings_ledger.py +++ b/legal-api/tests/unit/resources/v2/test_business_filings/test_filings_ledger.py @@ -172,6 +172,7 @@ def test_ledger_comment_count(app, session, client, jwt, monkeypatch, mock_drs_s business, filing_storage = ledger_element_setup_help(identifier) for c in range(number_of_comments): comment = Comment() + comment.comment_type = Comment.CommentType.STAFF comment.comment = f'this comment {c}' filing_storage.comments.append(comment) filing_storage.save() diff --git a/legal-api/tests/unit/resources/v2/test_filing_comments.py b/legal-api/tests/unit/resources/v2/test_filing_comments.py index 1699538f43..99689eb8ab 100644 --- a/legal-api/tests/unit/resources/v2/test_filing_comments.py +++ b/legal-api/tests/unit/resources/v2/test_filing_comments.py @@ -23,7 +23,7 @@ from freezegun import freeze_time from business_common.utils import datetime -from business_model.models import User +from business_model.models import Comment, User from legal_api.services.authz import BASIC_USER, STAFF_ROLE from registry_schemas.example_data import ANNUAL_REPORT, COMMENT_FILING from tests.unit.models import factory_business, factory_comment, factory_filing @@ -166,6 +166,9 @@ def test_post_comment(session, client, jwt): b = factory_business('CP1111111') f = factory_filing(b, ANNUAL_REPORT) + pre_comments = f.comments.all() + assert len(pre_comments) == 0 + json_data = copy.deepcopy(SAMPLE_JSON_DATA) json_data['comment']['filingId'] = f.id @@ -174,6 +177,10 @@ def test_post_comment(session, client, jwt): headers=create_header(jwt, [STAFF_ROLE])) assert HTTPStatus.CREATED == rv.status_code + + comments = f.comments.all() + assert len(comments) == 1 + assert comments[0].comment_type == Comment.CommentType.STAFF def test_post_comment_missing_filingid_error(session, client, jwt): diff --git a/queue_services/business-filer/poetry.lock b/queue_services/business-filer/poetry.lock index c919bf8b34..8b2132cd1d 100644 --- a/queue_services/business-filer/poetry.lock +++ b/queue_services/business-filer/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.2.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.3.1 and should not be changed by hand. [[package]] name = "aiofiles" @@ -294,7 +294,7 @@ files = [ [[package]] name = "business-model" -version = "3.3.30" +version = "3.3.32" description = "" optional = false python-versions = ">=3.13,<3.14" @@ -314,14 +314,14 @@ pg8000 = ">=1.31.2,<2.0.0" pycountry = ">=24.6.1,<25.0.0" pydantic = ">=2.10.6,<3.0.0" pytz = ">=2025.1,<2026.0" -registry-schemas = {git = "https://github.com/bcgov/business-schemas.git", rev = "2.18.70"} +registry-schemas = {git = "https://github.com/bcgov/business-schemas.git", rev = "2.18.73"} sql-versioning = {git = "https://github.com/bcgov/lear.git", rev = "main", subdirectory = "python/common/sql-versioning-alt"} [package.source] type = "git" url = "https://github.com/bcgov/lear.git" reference = "main" -resolved_reference = "b8fc78e3288b1627d0502accd76fc837748a6cbc" +resolved_reference = "295ecb7a24620142f1a18af02fb191df4cafcc85" subdirectory = "python/common/business-registry-model" [[package]] @@ -1257,7 +1257,7 @@ files = [ [package.dependencies] google-auth = ">=2.14.1,<3.0.0" googleapis-common-protos = ">=1.56.2,<2.0.0" -grpcio = {version = ">=1.49.1,<2.0dev", optional = true, markers = "python_version >= \"3.11\" and extra == \"grpc\""} +grpcio = {version = ">=1.49.1,<2.0.dev0", optional = true, markers = "python_version >= \"3.11\" and extra == \"grpc\""} grpcio-status = {version = ">=1.49.1,<2.0.dev0", optional = true, markers = "python_version >= \"3.11\" and extra == \"grpc\""} proto-plus = {version = ">=1.25.0,<2.0.0", markers = "python_version >= \"3.13\""} protobuf = ">=3.19.5,<3.20.0 || >3.20.0,<3.20.1 || >3.20.1,<4.21.0 || >4.21.0,<4.21.1 || >4.21.1,<4.21.2 || >4.21.2,<4.21.3 || >4.21.3,<4.21.4 || >4.21.4,<4.21.5 || >4.21.5,<7.0.0" @@ -1265,7 +1265,7 @@ requests = ">=2.18.0,<3.0.0" [package.extras] async-rest = ["google-auth[aiohttp] (>=2.35.0,<3.0.dev0)"] -grpc = ["grpcio (>=1.33.2,<2.0dev)", "grpcio (>=1.49.1,<2.0dev) ; python_version >= \"3.11\"", "grpcio-status (>=1.33.2,<2.0.dev0)", "grpcio-status (>=1.49.1,<2.0.dev0) ; python_version >= \"3.11\""] +grpc = ["grpcio (>=1.33.2,<2.0.dev0)", "grpcio (>=1.49.1,<2.0.dev0) ; python_version >= \"3.11\"", "grpcio-status (>=1.33.2,<2.0.dev0)", "grpcio-status (>=1.49.1,<2.0.dev0) ; python_version >= \"3.11\""] grpcgcp = ["grpcio-gcp (>=0.2.2,<1.0.dev0)"] grpcio-gcp = ["grpcio-gcp (>=0.2.2,<1.0.dev0)"] @@ -1307,11 +1307,11 @@ files = [ ] [package.dependencies] -google-api-core = ">=1.31.6,<2.0.dev0 || >2.3.0,<3.0.0dev" -google-auth = ">=1.25.0,<3.0dev" +google-api-core = ">=1.31.6,<2.0.dev0 || >2.3.0,<3.0.0.dev0" +google-auth = ">=1.25.0,<3.0.dev0" [package.extras] -grpc = ["grpcio (>=1.38.0,<2.0dev)", "grpcio-status (>=1.38.0,<2.0.dev0)"] +grpc = ["grpcio (>=1.38.0,<2.0.dev0)", "grpcio-status (>=1.38.0,<2.0.dev0)"] [[package]] name = "google-cloud-datastore" @@ -1326,11 +1326,11 @@ files = [ ] [package.dependencies] -google-api-core = {version = ">=1.34.0,<2.0.dev0 || >=2.11.dev0,<3.0.0dev", extras = ["grpc"]} -google-auth = ">=2.14.1,<2.24.0 || >2.24.0,<2.25.0 || >2.25.0,<3.0.0dev" -google-cloud-core = ">=1.4.0,<3.0.0dev" -proto-plus = {version = ">=1.22.2,<2.0.0dev", markers = "python_version >= \"3.11\""} -protobuf = ">=3.20.2,<4.21.0 || >4.21.0,<4.21.1 || >4.21.1,<4.21.2 || >4.21.2,<4.21.3 || >4.21.3,<4.21.4 || >4.21.4,<4.21.5 || >4.21.5,<6.0.0dev" +google-api-core = {version = ">=1.34.0,<2.0.dev0 || >=2.11.dev0,<3.0.0.dev0", extras = ["grpc"]} +google-auth = ">=2.14.1,<2.24.0 || >2.24.0,<2.25.0 || >2.25.0,<3.0.0.dev0" +google-cloud-core = ">=1.4.0,<3.0.0.dev0" +proto-plus = {version = ">=1.22.2,<2.0.0.dev0", markers = "python_version >= \"3.11\""} +protobuf = ">=3.20.2,<4.21.0 || >4.21.0,<4.21.1 || >4.21.1,<4.21.2 || >4.21.2,<4.21.3 || >4.21.3,<4.21.4 || >4.21.4,<4.21.5 || >4.21.5,<6.0.0.dev0" [package.extras] libcst = ["libcst (>=0.2.5)"] @@ -1564,7 +1564,7 @@ files = [ [package.dependencies] googleapis-common-protos = ">=1.5.5" grpcio = ">=1.71.0" -protobuf = ">=5.26.1,<6.0dev" +protobuf = ">=5.26.1,<6.0.dev0" [[package]] name = "gunicorn" @@ -1748,7 +1748,7 @@ fqdn = {version = "*", optional = true, markers = "extra == \"format\""} idna = {version = "*", optional = true, markers = "extra == \"format\""} isoduration = {version = "*", optional = true, markers = "extra == \"format\""} jsonpointer = {version = ">1.13", optional = true, markers = "extra == \"format\""} -jsonschema-specifications = ">=2023.03.6" +jsonschema-specifications = ">=2023.3.6" referencing = ">=0.28.4" rfc3339-validator = {version = "*", optional = true, markers = "extra == \"format\""} rfc3987 = {version = "*", optional = true, markers = "extra == \"format\""} @@ -2791,7 +2791,7 @@ rpds-py = ">=0.7.0" [[package]] name = "registry_schemas" -version = "2.18.70" +version = "2.18.73" description = "A short description of the project" optional = false python-versions = ">=3.6" @@ -2809,8 +2809,8 @@ strict-rfc3339 = "*" [package.source] type = "git" url = "https://github.com/bcgov/business-schemas.git" -reference = "2.18.70" -resolved_reference = "0c6917857384e00aec36f0fbca57d7ee58ba2e1c" +reference = "2.18.73" +resolved_reference = "e6999a46b6e38c52cc79f0e5a3c9fcbd0c473434" [[package]] name = "requests" diff --git a/queue_services/business-filer/src/business_filer/filing_processors/amalgamation_out.py b/queue_services/business-filer/src/business_filer/filing_processors/amalgamation_out.py index b315d3e9f2..520ea7e3c3 100644 --- a/queue_services/business-filer/src/business_filer/filing_processors/amalgamation_out.py +++ b/queue_services/business-filer/src/business_filer/filing_processors/amalgamation_out.py @@ -59,10 +59,11 @@ def process(business: Business, amalgamation_out_filing: Filing, filing: dict, f "amalgamationOutDate": amalgamation_out_date_str } - # add comment to the filing + # add filing comment to the filing amalgamation_out_filing.comments.append( Comment( comment=details, + comment_type=Comment.CommentType.FILING, staff_id=amalgamation_out_filing.submitter_id ) ) diff --git a/queue_services/business-filer/src/business_filer/filing_processors/consent_continuation_out.py b/queue_services/business-filer/src/business_filer/filing_processors/consent_continuation_out.py index 74a3d66a58..a10c868b63 100644 --- a/queue_services/business-filer/src/business_filer/filing_processors/consent_continuation_out.py +++ b/queue_services/business-filer/src/business_filer/filing_processors/consent_continuation_out.py @@ -79,6 +79,7 @@ def process(business: Business, cco_filing: Filing, filing: dict, filing_meta: F cco_filing.comments.append( Comment( comment=details, + comment_type=Comment.CommentType.FILING, staff_id=cco_filing.submitter_id ) ) diff --git a/queue_services/business-filer/src/business_filer/filing_processors/continuation_out.py b/queue_services/business-filer/src/business_filer/filing_processors/continuation_out.py index b25836b585..03b56ad515 100644 --- a/queue_services/business-filer/src/business_filer/filing_processors/continuation_out.py +++ b/queue_services/business-filer/src/business_filer/filing_processors/continuation_out.py @@ -117,6 +117,7 @@ def process(business: Business, continuation_out_filing: Filing, filing: dict, f continuation_out_filing.comments.append( Comment( comment=details, + comment_type=Comment.CommentType.FILING, staff_id=continuation_out_filing.submitter_id ) ) diff --git a/queue_services/business-filer/src/business_filer/filing_processors/correction.py b/queue_services/business-filer/src/business_filer/filing_processors/correction.py index a73f4b94bd..e3a4b02800 100644 --- a/queue_services/business-filer/src/business_filer/filing_processors/correction.py +++ b/queue_services/business-filer/src/business_filer/filing_processors/correction.py @@ -60,6 +60,7 @@ def process(correction_filing: Filing, filing: dict, filing_meta: FilingMeta, bu Comment( comment=f"This filing was corrected on " f"{correction_filing.filing_date.astimezone(local_timezone).date().isoformat()}.", + comment_type=Comment.CommentType.FILING, staff_id=correction_filing.submitter_id ) ) @@ -70,6 +71,7 @@ def process(correction_filing: Filing, filing: dict, filing_meta: FilingMeta, bu correction_filing.comments.append( Comment( comment=filing["correction"]["comment"], + comment_type=Comment.CommentType.FILING, staff_id=correction_filing.submitter_id ) ) diff --git a/queue_services/business-filer/tests/unit/test_filer/test_amalgamation_out.py b/queue_services/business-filer/tests/unit/test_filer/test_amalgamation_out.py index 8d191fd546..f83ee2d104 100644 --- a/queue_services/business-filer/tests/unit/test_filer/test_amalgamation_out.py +++ b/queue_services/business-filer/tests/unit/test_filer/test_amalgamation_out.py @@ -15,11 +15,9 @@ import copy import random -from datetime import datetime, timezone -from business_model.models import Business, Filing - -from registry_schemas.example_data import AMALGAMATION_OUT, FILING_TEMPLATE +from business_model.models import Business, Comment, Filing from business_model.utils.legislation_datetime import LegislationDatetime +from registry_schemas.example_data import AMALGAMATION_OUT, FILING_TEMPLATE from business_filer.filing_meta import FilingMeta from business_filer.filing_processors import amalgamation_out @@ -69,3 +67,4 @@ def tests_filer_amalgamation_out(app, session): filing_comments = final_filing.comments.all() assert len(filing_comments) == 1 assert filing_comments[0].comment == details + assert filing_comments[0].comment_type == Comment.CommentType.FILING diff --git a/queue_services/business-filer/tests/unit/test_filer/test_consent_continuation_out.py b/queue_services/business-filer/tests/unit/test_filer/test_consent_continuation_out.py index 1dbcd4b014..bef79d82b5 100644 --- a/queue_services/business-filer/tests/unit/test_filer/test_consent_continuation_out.py +++ b/queue_services/business-filer/tests/unit/test_filer/test_consent_continuation_out.py @@ -37,7 +37,7 @@ from datetime import datetime, timezone import pytest -from business_model.models import ConsentContinuationOut, Filing +from business_model.models import Comment, ConsentContinuationOut, Filing from business_filer.common.legislation_datetime import LegislationDatetime from registry_schemas.example_data import CONSENT_CONTINUATION_OUT, FILING_TEMPLATE @@ -112,3 +112,8 @@ def tests_filer_consent_continuation_out(app, session, mocker, test_name, effect assert final_filing.meta_data['consentContinuationOut']['region'] == \ filing_json['filing']['consentContinuationOut']['foreignJurisdiction']['region'] assert final_filing.meta_data['consentContinuationOut']['expiry'] == expiry_date_utc.isoformat() + + filing_comments = final_filing.comments.all() + assert len(filing_comments) == 1 + assert filing_comments[0].comment == filing_json['filing']['consentContinuationOut']['details'] + assert filing_comments[0].comment_type == Comment.CommentType.FILING diff --git a/queue_services/business-filer/tests/unit/test_filer/test_continuation_out.py b/queue_services/business-filer/tests/unit/test_filer/test_continuation_out.py index 0dac617e3f..464f507ab2 100644 --- a/queue_services/business-filer/tests/unit/test_filer/test_continuation_out.py +++ b/queue_services/business-filer/tests/unit/test_filer/test_continuation_out.py @@ -35,12 +35,10 @@ import copy import random -from datetime import datetime, timezone -from business_model.models import Business, Document, Filing - +from business_model.models import Business, Comment, Document, Filing from registry_schemas.example_data import CONTINUATION_OUT, FILING_TEMPLATE -from business_filer.common.legislation_datetime import LegislationDatetime +from business_filer.common.legislation_datetime import LegislationDatetime from business_filer.filing_meta import FilingMeta from business_filer.filing_processors import continuation_out from business_filer.filing_processors.continuation_out import CONTINUATION_OUT_DOCUMENT_TYPE @@ -127,6 +125,11 @@ def tests_filer_continuation_out_uploaded_documents(app, session): assert len(meta_documents) == len(uploaded_documents) for file in uploaded_documents: assert file in meta_documents + + filing_comments = final_filing.comments.all() + assert len(filing_comments) == 1 + assert filing_comments[0].comment == filing_json['filing']['continuationOut']['details'] + assert filing_comments[0].comment_type == Comment.CommentType.FILING def tests_filer_continuation_out_no_uploaded_documents(app, session): diff --git a/queue_services/business-filer/tests/unit/test_filer/test_correction.py b/queue_services/business-filer/tests/unit/test_filer/test_correction.py index 2440fa467a..cc0b2c0ffc 100644 --- a/queue_services/business-filer/tests/unit/test_filer/test_correction.py +++ b/queue_services/business-filer/tests/unit/test_filer/test_correction.py @@ -36,7 +36,7 @@ import pytest import random -from business_model.models import Business, Filing, PartyRole +from business_model.models import Business, Comment, Filing, PartyRole from registry_schemas.example_data import ( CHANGE_OF_DIRECTORS, CHANGE_OF_RECEIVERS, @@ -65,6 +65,23 @@ def _assert_common_data(business: Business, filing: Filing): assert filing.transaction_id assert filing.business_id == business.id assert filing.status == Filing.Status.COMPLETED.value + + +def _assert_correction_comments(filing: Filing): + """Assert the expected correction comments were added.""" + original_filing = Filing.find_by_id(filing.filing_json["filing"]["correction"]["correctedFilingId"]) + + filing_comments = filing.comments.all() + original_filing_comments = original_filing.comments.all() + + assert len(filing_comments) == 1 + assert len(original_filing_comments) == 1 + + assert original_filing_comments[0].comment_type == Comment.CommentType.FILING + assert filing_comments[0].comment_type == Comment.CommentType.FILING + + assert "This filing was corrected on " in original_filing_comments[0].comment + assert filing_comments[0].comment == filing.filing_json["filing"]["correction"]["comment"] def _get_filing(filing_type: str, data: dict, identifier = 'BC1234567', needs_template = True): @@ -129,6 +146,7 @@ def test_process_correction_filing_with_relationships(app, session, mocker, fili correction_processed_filing: Filing = Filing.find_by_id(correction_filing_rec.id) # assert changes _assert_common_data(business, correction_processed_filing) + _assert_correction_comments(correction_processed_filing) assert correction_processed_filing.lear_only == expected_lear_only party_roles: list[PartyRole] = business.party_roles.all() assert len(party_roles) == 2