Compare commits

...
2 Commits
Author SHA1 Message Date
Tim Glaser e9862cf671 Fix properties undefined error 2020-02-18 15:44:56 -08:00
Tim Glaser 0ce011a36d Correctly send in properties 2020-02-17 19:20:57 -08:00
3 changed files with 7 additions and 7 deletions
+4 -2
View File
@@ -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))
+2 -4
View File
@@ -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
View File
@@ -1 +1 @@
VERSION = '1.0.6'
VERSION = '1.0.8'