This repository was archived by the owner on Aug 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from klaviyo/202106_fix_identify_call
fix identify call
- Loading branch information
Showing
5 changed files
with
45 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
## CHANGELOG | ||
|
||
### 3.1.3 | ||
- Fix identify ID call. | ||
|
||
### 3.1.2 | ||
- Added support for Campaigns API | ||
|
||
|
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
__version__ = '3.1.2' | ||
__version__ = '3.1.3' | ||
from .api import Klaviyo |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from mock import patch | ||
import pytest | ||
from klaviyo.public import Public | ||
from .api_helper import KlaviyoAPIFixture | ||
|
||
class PublicFixture(KlaviyoAPIFixture): | ||
@property | ||
def api(self): | ||
return Public(**self.API_SETTINGS) | ||
|
||
@pytest.fixture | ||
def mock_email(self): | ||
return 'thomas.jefferson@mailinator.com' | ||
|
||
@pytest.fixture | ||
def mock_external_id(self): | ||
return 123 |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import pytest | ||
from .fixtures.public import PublicFixture | ||
from klaviyo.exceptions import ( | ||
KlaviyoException | ||
) | ||
|
||
|
||
class TestPublicApi(PublicFixture): | ||
def test_identify_with_id(self, mock_email, mock_external_id, mock_request): | ||
self.api.identify(mock_email, mock_external_id) | ||
mock_request.assert_called_once() | ||
|
||
def test_identify_without_id(self, mock_email, mock_request): | ||
self.api.identify(mock_email) | ||
mock_request.assert_called_once() | ||
|
||
def test_identify_without_identification(self): | ||
with pytest.raises(KlaviyoException): | ||
self.api.identify() |