-
Notifications
You must be signed in to change notification settings - Fork 429
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(hubspot): create hubspot company with domain (#3844)
- Loading branch information
1 parent
210dbf7
commit d4c9173
Showing
2 changed files
with
10 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,10 +36,12 @@ def test_track_hubspot_lead_without_organisation( | |
# Given | ||
hubspot_company_id = "company-id" | ||
hubspot_contact_id = "contact-id" | ||
domain = "example.com" | ||
email = f"test@{domain}" | ||
|
||
settings.ENABLE_HUBSPOT_LEAD_TRACKING = True | ||
|
||
user = FFAdminUser.objects.create(email="[email protected]") | ||
user = FFAdminUser.objects.create(email=email) | ||
|
||
mock_hubspot_client = mocker.MagicMock(spec=HubspotClient) | ||
mocker.patch( | ||
|
@@ -56,5 +58,8 @@ def test_track_hubspot_lead_without_organisation( | |
track_hubspot_lead_without_organisation(user_id=user.id) | ||
|
||
# Then | ||
mock_hubspot_client.create_company.assert_called_once_with( | ||
name=domain, domain=domain | ||
) | ||
mock_hubspot_client.create_contact.assert_called_once_with(user, hubspot_company_id) | ||
assert HubspotLead.objects.filter(user=user).exists() |