From 1937c913d5c657ad43a31e30951271a1abe7b184 Mon Sep 17 00:00:00 2001 From: Adam Sachs Date: Mon, 6 Nov 2023 09:26:50 -0800 Subject: [PATCH] support previous_vendor_id attribute on System model --- src/fideslang/models.py | 3 +++ tests/fideslang/test_models.py | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/fideslang/models.py b/src/fideslang/models.py index 89bc7cf..b5c177a 100644 --- a/src/fideslang/models.py +++ b/src/fideslang/models.py @@ -1165,6 +1165,9 @@ class System(FidesModel): vendor_id: Optional[str] = Field( description="The unique identifier for the vendor that's associated with this system." ) + previous_vendor_id: Optional[str] = Field( + description="If specified, the unique identifier for the vendor that was previously associated with this system." + ) dataset_references: List[FidesKey] = Field( default_factory=list, description="Referenced Dataset fides keys used by the system.", diff --git a/tests/fideslang/test_models.py b/tests/fideslang/test_models.py index 05fa592..98bfb29 100644 --- a/tests/fideslang/test_models.py +++ b/tests/fideslang/test_models.py @@ -92,6 +92,10 @@ def test_privacy_declaration_data_qualifier_deprecation(self) -> None: class TestSystem: + # TODO: these tests are not effectively evaluating whether the provided constructor args + # are actually supported, because our `System` model does not prohibit "extra" fields. + # We need to update these tests to assert that the provided args are actually being set + # as attributes on the System instance that's instantiated. def test_system_valid(self) -> None: assert System( description="Test Policy", @@ -390,13 +394,14 @@ def test_expanded_system(self): data_shared_with_third_parties=True, third_parties="advertising; marketing", shared_categories=[], + flexible_legal_basis_for_processing=True, cookies=[ {"name": "ANON_ID", "path": "/", "domain": "tribalfusion.com"} ], ) ], third_country_transfers=["ARM"], - vendor_id="1", + vendor_id="gvl.1", dataset_references=["test_fides_key_dataset"], processes_personal_data=True, exempt_from_privacy_regulations=False, @@ -419,7 +424,7 @@ def test_expanded_system(self): cookie_refresh=True, uses_non_cookie_access=True, legitimate_interest_disclosure_url="http://www.example.com/legitimate_interest_disclosure", - flexible_legal_basis_for_processing=True, + previous_vendor_id="gacp.10", cookies=[ { "name": "COOKIE_ID_EXAMPLE",