예제 #1
0
 def setUpClass(self):
     self.app = pp_tests.get_app()
     self.connection, self.db = pp_tests.connect_to_mongo()
     self.account = Accounts(self.db, {
         'email': '*****@*****.**',
         'password': '******',
         'name': 'Daniel',
         'startup': 'Payparrot',
         'url': 'http://payparrot.com/',
         'callback_url': 'http://www.epistemonikos.org',
         'notification_url': 'http://www.epistemonikos.org',
     })
     self.account.insert()
     
     self.message = Messages(self.db, {
         'account_id': self.account.id,
         'text': 'Hola Mundo %s' % randint(0, 100000),
         'url': 'http://es.wikipedia.org/wiki/Hola_mundo',
         'status': True,
         'active': True
     })
     self.message.insert()
     
     self.redirect = self.app.get('/parrots/start?external_id=1&token=%s' % self.account.credentials['public_token'])
     print "\n", self.redirect.location
     url = raw_input("Final url? ")
     query_string = urlparse(url).query
     self.finish_response = self.app.get('/parrots/finish?%s' % (query_string))
예제 #2
0
 def setUp(self):
     self.app = pp_test.get_app()
     self.connection, self.db = pp_test.connect_to_mongo()
     self.account_data = {
         'email': '*****@*****.**',
         'password': '******',
         'name': 'Daniel',
         'startup': 'Payparrot',
         'url': 'http://payparrot.com/',
         'callback_url': 'http://demo.payparrot.com',
         'notification_url': 'http://demo.payparrot.com/notifications'
     }
     self.response = self.app.post_json('/accounts', self.account_data)
예제 #3
0
 def setUp(self):
     self.app = pp_tests.get_app()
     self.db = pp_tests.connect_to_mongo()
     self.account = Accounts(self.db, {
         'email': '*****@*****.**',
         'password': '******',
         'name': 'Daniel',
         'startup': 'Payparrot',
         'url': 'http://payparrot.com/',
         'callback_url': 'http://www.epistemonikos.org',
     })
     self.account.insert()
     self.redirect = self.app.get('/parrots/start?external_id=1&token=%s' % self.account.credentials['public_token'])
예제 #4
0
 def setUp(self):
     self.app = pp_test.get_app()
     self.connection, self.db = pp_test.connect_to_mongo()
     self.account_data = {
         "email": "*****@*****.**",
         "password": "******",
         "name": "Daniel",
         "startup": "Payparrot",
         "url": "http://payparrot.com/",
         "callback_url": "http://demo.payparrot.com",
         "notification_url": "http://demo.payparrot.com/notifications",
     }
     self.response = self.app.post_json("/accounts", self.account_data)
     self.maxDiff = None
예제 #5
0
 def setUpClass(self):
     self.app = pp_tests.get_app()
     self.db = pp_tests.connect_to_mongo()
     self.account = Accounts(self.db, {
         'email': '*****@*****.**',
         'password': '******',
         'name': 'Daniel',
         'startup': 'Payparrot',
         'url': 'http://payparrot.com/',
         'callback_url': 'http://www.epistemonikos.org',
         'notification_url': 'http://www.epistemonikos.org',
     })
     self.account.insert()
     self.redirect = self.app.get('/parrots/start?external_id=1&token=%s' % self.account.credentials['public_token'])
     print "\n", self.redirect.location
     url = raw_input("Final url? ")
     query_string = urlparse(url).query
     self.finish_response = self.app.get('/parrots/finish?%s' % (query_string))
예제 #6
0
 def setUp(self):
     self.app = pp_tests.get_app()
     self.connection, self.db = pp_tests.connect_to_mongo()
     self.account = pp_tests.create_account_and_login(self.app, self.db, {
         'email': '*****@*****.**',
         'password': '******',
         'name': 'Daniel',
         'startup': 'Payparrot',
         'url': 'http://payparrot.com/',
         'callback_url': 'http://www.epistemonikos.org',
         'notification_url': 'http://www.epistemonikos.org',
     })
     self.parrot = Parrots(self.db, {
         'twitter_id': '123123123',
         'oauth_token': 'asd',
         'oauth_token_secret': 'asdf',
         'twitter_info': {},
         'payments': [],
         'twitter_info': {
             'screen_name': 'danielgua'
         }
     })
     self.parrot.insert()
     self.subscription = Subscriptions(self.db, {'account_id': self.account.id, 'active': True, 'parrot_id': self.parrot.id, 'twitter_screen_name': self.parrot.twitter_info.get("screen_name")})
     self.subscription.insert()
         
     self.parrot1 = Parrots(self.db, {
         'twitter_id': '4322143214',
         'oauth_token': 'asd',
         'oauth_token_secret': 'asdf',
         'twitter_info': {},
         'payments': [],
         'twitter_info': {
             'screen_name': 'blabla'
         }
     })
     self.parrot1.insert()
     self.subscription1 = Subscriptions(self.db, {'account_id': self.account.id, 'active': True, 'parrot_id': self.parrot1.id,'twitter_screen_name': self.parrot1.twitter_info.get("screen_name")})        
     self.subscription1.insert()
예제 #7
0
 def setUp(self):
     self.app = pp_tests.get_app()
     self.connection, self.db = pp_tests.connect_to_mongo()
     self.account = pp_tests.create_account_and_login(self.app, self.db, {
         'email': '*****@*****.**',
         'password': '******',
         'name': 'Daniel',
         'startup': 'Payparrot',
         'url': 'http://payparrot.com/',
         'callback_url': 'http://www.epistemonikos.org',
         'notification_url': 'http://www.epistemonikos.org',
     })
         
     self.notification = Notifications(self.db, {
         'suscription_id': ObjectId(),
         'account_id': self.account.id,
         'external_id': '238462834',
         'parrot_id': ObjectId(),
         'request_url': 'http://localhost:3000/notifications/echo',
         'status': 'pending',
         'type': 'subscription_activated'
     })
     self.notification.insert()