From ce27f401a9b402a9097c6db7a6cc2c4aa9e7ee35 Mon Sep 17 00:00:00 2001 From: Keyur Date: Fri, 15 Nov 2019 16:27:48 -0800 Subject: [PATCH] Add: Campaign object to Update User and Company test Add: Campaign object to Update User and Company test Refactor: Update moesifapi version to 1.2.8 Refactor: Update README.md Bump version to 1.7.1 --- README.md | 6 ++++-- requirements.txt | 2 +- setup.py | 2 +- tests/middleware_pre19_tests/tests.py | 6 ++++-- tests/middleware_tests/tests.py | 6 ++++-- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index fa3b55f..6fd99ca 100755 --- a/README.md +++ b/README.md @@ -248,7 +248,8 @@ update_user = middleware.update_user({ 'user_id': '12345', 'company_id': '67890', 'session_token': 'jkj9324-23489y5324-ksndf8-d9syf8', - 'metadata': {'email': 'abc@email.com', 'name': 'abcde', 'image': '1234'} + 'metadata': {'email': 'abc@email.com', 'name': 'abcde', 'image': '1234'}, + 'campaign': {'utm_source': 'Newsletter', 'utm_medium': 'Email'} }) ``` @@ -280,7 +281,8 @@ middleware = MoesifMiddleware(None) update_company = middleware.update_company({ 'company_id': '12345', 'company_domain': 'acmeinc.com', - 'metadata': {'email': 'abc@email.com', 'name': 'abcde', 'image': '1234'} + 'metadata': {'email': 'abc@email.com', 'name': 'abcde', 'image': '1234'}, + 'campaign': {'utm_source': 'Adwords', 'utm_medium': 'Twitter'} }) ``` diff --git a/requirements.txt b/requirements.txt index c4bff15..35cd736 100755 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ jsonpickle==0.7.1 python-dateutil==2.5.3 nose==1.3.7 isodatetimehandler==1.0.2 -moesifapi==1.2.6 +moesifapi==1.2.8 celery>=3.1.25 moesifpythonrequest==0.1.11 apscheduler==3.6.1 diff --git a/setup.py b/setup.py index 0fad3a5..58fc51b 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # https://packaging.python.org/en/latest/single_source_version.html - version='1.7.0', + version='1.7.1', description='Moesif Middleware for Python Django', long_description=long_description, diff --git a/tests/middleware_pre19_tests/tests.py b/tests/middleware_pre19_tests/tests.py index 973e132..d647a9e 100644 --- a/tests/middleware_pre19_tests/tests.py +++ b/tests/middleware_pre19_tests/tests.py @@ -38,7 +38,8 @@ def testUpdateUser(self): 'user_id': '12345', 'company_id' : '67890', 'session_token': 'jkj9324-23489y5324-ksndf8-d9syf8', - 'metadata': {'email': 'abc@email.com', 'name': 'abcde', 'image': '1234'} + 'metadata': {'email': 'abc@email.com', 'name': 'abcde', 'image': '1234'}, + 'campaign': {'utm_source': 'Newsletter', 'utm_medium': 'Email'} }) class UpdateUsersBatchTest(SimpleTestCase): @@ -60,7 +61,8 @@ def testUpdateCompany(self): MoesifMiddlewarePre19().update_company({ 'company_id': '12345', 'company_domain': 'acmeinc.com', - 'metadata': {'email': 'abc@email.com', 'name': 'abcde', 'image': '1234'} + 'metadata': {'email': 'abc@email.com', 'name': 'abcde', 'image': '1234'}, + 'campaign': {'utm_source': 'Adwords', 'utm_medium': 'Twitter'} }) class UpdateCompaniesBatchTest(SimpleTestCase): diff --git a/tests/middleware_tests/tests.py b/tests/middleware_tests/tests.py index 2e2a8f3..374c0d9 100644 --- a/tests/middleware_tests/tests.py +++ b/tests/middleware_tests/tests.py @@ -35,7 +35,8 @@ def testUpdateUser(self): 'user_id': '12345', 'company_id' : '67890', 'session_token': 'jkj9324-23489y5324-ksndf8-d9syf8', - 'metadata': {'email': 'abc@email.com', 'name': 'abcde', 'image': '1234'} + 'metadata': {'email': 'abc@email.com', 'name': 'abcde', 'image': '1234'}, + 'campaign': {'utm_source': 'Newsletter', 'utm_medium': 'Email'} }) @@ -60,7 +61,8 @@ def testUpdateCompany(self): middleware.update_company({ 'company_id': '12345', 'company_domain': 'acmeinc.com', - 'metadata': {'email': 'abc@email.com', 'name': 'abcde', 'image': '1234'} + 'metadata': {'email': 'abc@email.com', 'name': 'abcde', 'image': '1234'}, + 'campaign': {'utm_source': 'Adwords', 'utm_medium': 'Twitter'} })