Skip to content

Commit

Permalink
Merge pull request #38 from Moesif/add-campaign-object
Browse files Browse the repository at this point in the history
Add: Campaign object to Update User and Company test
  • Loading branch information
dgilling authored Nov 16, 2019
2 parents dd49eb4 + ce27f40 commit 41729d8
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'}
})
```

Expand Down Expand Up @@ -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'}
})
```

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 4 additions & 2 deletions tests/middleware_pre19_tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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):
Expand Down
6 changes: 4 additions & 2 deletions tests/middleware_tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'}
})


Expand All @@ -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'}
})


Expand Down

0 comments on commit 41729d8

Please sign in to comment.