-
Notifications
You must be signed in to change notification settings - Fork 626
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add 'advanced_measurement_table' arg to event
Summary: Argument added to CAPI Graph endpoint in D28614990, reflecting the changes in the SDK as well Reviewed By: HanyanLiu Differential Revision: D43889230 fbshipit-source-id: 9c5e5f3df8ac30dc281421f66ea6d472fc2d857d
- Loading branch information
1 parent
221390e
commit 39ac7a9
Showing
3 changed files
with
89 additions
and
4 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
56 changes: 56 additions & 0 deletions
56
facebook_business/adobjects/serverside/tests/event_am_test.py
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,56 @@ | ||
# Copyright 2014 Facebook, Inc. | ||
|
||
# You are hereby granted a non-exclusive, worldwide, royalty-free license to | ||
# use, copy, modify, and distribute this software in source code or binary | ||
# form for use in connection with the web services and APIs provided by | ||
# Facebook. | ||
|
||
# As with any software that integrates with the Facebook platform, your use | ||
# of this software is subject to the Facebook Developer Principles and | ||
# Policies [http://developers.facebook.com/policy/]. This copyright notice | ||
# shall be included in all copies or substantial portions of the software. | ||
|
||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
# DEALINGS IN THE SOFTWARE. | ||
|
||
from unittest import TestCase | ||
|
||
from facebook_business import FacebookAdsApi | ||
from facebook_business.adobjects.serverside.action_source import ActionSource | ||
from facebook_business.adobjects.serverside.custom_data import CustomData | ||
from facebook_business.adobjects.serverside.event import Event | ||
from facebook_business.adobjects.serverside.user_data import UserData | ||
|
||
|
||
class EventAmTest(TestCase): | ||
def test_constructor(self): | ||
event_name = 'custom' | ||
event_time = 123 | ||
user_data = UserData(email='eg@test.com') | ||
custom_data = CustomData(custom_properties={'col_1': 'foo'}) | ||
data_processing_options = ['AMO'] | ||
advanced_measurement_table = 'test_am_table' | ||
event = Event( | ||
event_name=event_name, | ||
event_time=event_time, | ||
user_data=user_data, | ||
custom_data=custom_data, | ||
data_processing_options=data_processing_options, | ||
action_source=None, | ||
advanced_measurement_table=advanced_measurement_table | ||
) | ||
expected_params = { | ||
'event_name': event_name, | ||
'event_time': event_time, | ||
'user_data': user_data.normalize(), | ||
'custom_data': custom_data.normalize(), | ||
'data_processing_options': data_processing_options, | ||
'advanced_measurement_table': advanced_measurement_table | ||
} | ||
|
||
self.assertEqual(event.normalize(), expected_params) |