You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.2 KiB
Python
42 lines
1.2 KiB
Python
7 years ago
|
from api.User import User
|
||
|
import unittest
|
||
|
import json
|
||
|
import stripe
|
||
|
|
||
|
f = open('../config.json')
|
||
|
CONFIG = json.loads(f.read())
|
||
|
f.close()
|
||
|
|
||
|
stripe.api_key = CONFIG['stripe']['secret']
|
||
|
class TestUser(unittest.TestCase):
|
||
|
def test_CreateUser(self):
|
||
|
user = User(stripe=stripe,store=CONFIG['couchdb'],product='music')
|
||
|
self.assertTrue('_id' not in user.me)
|
||
|
self.assertTrue('info' in user.me)
|
||
|
def test_EditUser(self):
|
||
|
user = User(stripe=stripe,store=CONFIG['couchdb'],product='music')
|
||
|
user.update(emails=['nyemba@gmail.com'])
|
||
|
user.update(emails='steve@the-phi.com')
|
||
|
# user.post()
|
||
|
self.assertTrue(user.me)
|
||
|
self.assertTrue('emails' in user.me)
|
||
|
for email in ['nyemba@gmail.com','steve@the-phi.com'] :
|
||
|
self.assertTrue(email in user.me['emails'])
|
||
|
|
||
|
def test_SubscribeNewUser(self):
|
||
|
user = User(stripe=stripe,store=CONFIG['couchdb'],product='music')
|
||
|
user.subscribe('nyemba@gmail.com')
|
||
|
|
||
|
# self.assertTrue('subscriptions' in user.me)
|
||
|
pass
|
||
|
def test_UpdatePlan(self):
|
||
|
user = User(stripe=stripe,store=CONFIG['couchdb'],product='music')
|
||
|
user.refresh("nyemba@gmail.com")
|
||
|
def test_UserSubscriptions(self):
|
||
|
|
||
|
pass
|
||
|
def test_Products(self):
|
||
|
pass
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
unittest.main()
|