Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e9862cf671 | ||
|
|
0ce011a36d |
+4
-2
@@ -218,8 +218,10 @@ class Client(object):
|
||||
timestamp = guess_timezone(timestamp)
|
||||
msg['timestamp'] = timestamp.isoformat()
|
||||
msg['messageId'] = stringify_id(message_id)
|
||||
msg['library'] = 'posthog-python'
|
||||
msg['library_version'] = VERSION
|
||||
if not msg.get('properties'):
|
||||
msg['properties'] = {}
|
||||
msg['properties']['$lib'] = 'posthog-python'
|
||||
msg['properties']['$lib_version'] = VERSION
|
||||
|
||||
msg['distinct_id'] = stringify_id(msg.get('distinct_id', None))
|
||||
|
||||
|
||||
@@ -63,10 +63,8 @@ class TestClient(unittest.TestCase):
|
||||
self.assertEqual(msg['properties'], {'property': 'value'})
|
||||
self.assertEqual(msg['context']['ip'], '192.168.0.1')
|
||||
self.assertEqual(msg['event'], 'python test event')
|
||||
self.assertEqual(msg['context']['library'], {
|
||||
'name': 'analytics-python',
|
||||
'version': VERSION
|
||||
})
|
||||
self.assertEqual(msg['properties']['$lib'], 'posthog-python')
|
||||
self.assertEqual(msg['properties']['$lib_version'], VERSION)
|
||||
self.assertEqual(msg['messageId'], 'messageId')
|
||||
self.assertEqual(msg['distinct_id'], 'distinct_id')
|
||||
self.assertEqual(msg['type'], 'track')
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
VERSION = '1.0.6'
|
||||
VERSION = '1.0.8'
|
||||
|
||||
Reference in New Issue
Block a user