Skip to content

Commit

Permalink
Updating tests
Browse files Browse the repository at this point in the history
  • Loading branch information
galvana committed Oct 25, 2023
1 parent 41c0795 commit 51a9d9a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion data/saas/config/hubspot_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ saas_config:
source: body
path: paging.next.link
update:
request_override: hubspot_contacts_update
param_values:
- name: contactId
references:
- dataset: <instance_fides_key>
field: contacts.id
direction: from
request_override: hubspot_contacts_update
- name: owners
requests:
read:
Expand Down
13 changes: 6 additions & 7 deletions tests/ops/integration_tests/saas/test_hubspot_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ async def test_hubspot_access_request_task(
}
assert set(filtered_results[f"{dataset_name}:contacts"][0].keys()) == {
"id",
"createdAt",
"updatedAt",
"properties",
}

Expand All @@ -118,7 +116,6 @@ async def test_hubspot_access_request_task(
"email",
"id",
"userId",
"updatedAt",
"firstName",
"lastName",
}
Expand All @@ -133,7 +130,7 @@ async def test_hubspot_access_request_task(
async def test_hubspot_erasure_request_task(
db,
policy,
erasure_policy_string_rewrite,
erasure_policy_string_rewrite_name_and_email,
connection_config_hubspot,
dataset_config_hubspot,
hubspot_erasure_identity_email,
Expand Down Expand Up @@ -173,7 +170,7 @@ async def test_hubspot_erasure_request_task(
CONFIG.execution.masking_strict = False # Allow delete
x = await graph_task.run_erasure(
privacy_request,
erasure_policy_string_rewrite,
erasure_policy_string_rewrite_name_and_email,
graph,
[connection_config_hubspot],
identity_kwargs,
Expand All @@ -186,21 +183,23 @@ async def test_hubspot_erasure_request_task(
assert x == {
"hubspot_instance:contacts": 1,
"hubspot_instance:owners": 0,
"hubspot_instance:subscription_preferences": 1,
"hubspot_instance:subscription_preferences": 2,
"hubspot_instance:users": 1,
}

# Verify the user has been assigned to None
contact_response = hubspot_test_client.get_contact(contact_id=contact_id)
contact_body = contact_response.json()
assert contact_body["properties"]["firstname"] == "MASKED"
assert contact_body["properties"]["email"] == f"{privacy_request.id}@company.com"

# verify user is unsubscribed
email_subscription_response = hubspot_test_client.get_email_subscriptions(
email=hubspot_erasure_identity_email
)
subscription_body = email_subscription_response.json()
assert subscription_body["subscriptionStatuses"][0]["status"] == "NOT_SUBSCRIBED"
for subscription_status in subscription_body["subscriptionStatuses"]:
assert subscription_status["status"] == "NOT_SUBSCRIBED"

# verify user is deleted
error_message = f"User with user id {user_id} could not be deleted from Hubspot"
Expand Down

0 comments on commit 51a9d9a

Please sign in to comment.