Esempio n. 1
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()
Esempio n. 2
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()