From ac49622008835aa69c8ef12fc0974002a0263454 Mon Sep 17 00:00:00 2001 From: Arwen Qin <122495122+ArwenQin@users.noreply.github.com> Date: Tue, 5 Nov 2024 11:57:58 -0800 Subject: [PATCH] 24131 - Fix Director Change Output (#3059) --- legal-api/src/legal_api/models/filing.py | 4 ++-- legal-api/tests/unit/core/test_filing.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/legal-api/src/legal_api/models/filing.py b/legal-api/src/legal_api/models/filing.py index ee1295f18..8da1c160e 100644 --- a/legal-api/src/legal_api/models/filing.py +++ b/legal-api/src/legal_api/models/filing.py @@ -740,9 +740,9 @@ def set_processed(self, business_type): self.effective_date = self.payment_completion_date def effective_date_can_be_before_payment_completion_date(self, business_type): - """For AR or COD filings on CP or BEN then the effective date can be before the payment date.""" + """For AR or COD filings then the effective date can be before the payment date.""" return self.filing_type in (Filing.FILINGS['annualReport'].get('name'), - Filing.FILINGS['changeOfDirectors'].get('name')) and business_type in {'CP', 'BEN'} + Filing.FILINGS['changeOfDirectors'].get('name')) @staticmethod def _raise_default_lock_exception(): diff --git a/legal-api/tests/unit/core/test_filing.py b/legal-api/tests/unit/core/test_filing.py index 43fd16b09..3b9266759 100644 --- a/legal-api/tests/unit/core/test_filing.py +++ b/legal-api/tests/unit/core/test_filing.py @@ -179,14 +179,15 @@ def test_set_effective(session): filing.storage.set_processed(legal_type) - # assert that the effective date is the payment date + # assert that the effective date is now, instead of the payment date assert filing._storage.effective_date - assert filing._storage.effective_date.replace(tzinfo=None) == payment_date.replace(tzinfo=None) + assert filing._storage.effective_date.replace(tzinfo=None) == now.replace(tzinfo=None) assert not filing.is_future_effective future_date = now + datedelta.DAY alt_payment_date = now filing._storage.skip_status_listener = True + filing._storage.effective_date = now + datedelta.DAY filing._storage.payment_completion_date = alt_payment_date filing._storage.save()