Пример #1
0
    def test_api(self):
        cfg = ConfigParser()
        props = os.path.join(os.path.dirname(__file__), 'sochange.properties')
        cfg.read(props)
        
        partnerPassword = cfg.get("config", "partnerPassword")
        partnerUserID = cfg.get("config", "partnerUserID")
        partnerUserSecret = cfg.get("config", "partnerUserSecret")
        
        api = Expensify(partnerUserID, partnerUserSecret)
        
        logging.info("Authenticating")
        authJson = api.authenticate()
        
        logging.info("Creating account")
        accountJson = api.createAccount('*****@*****.**')
        
        logging.info("JSON: %s", accountJson)
        # This account should already exist, returning 300 
        self.failUnlessEqual(accountJson['jsonCode'], 300)
        
        transactionJson = api.getTransactionList()
        self.failUnless('transactionList' in transactionJson, 'No transaction list')

        cardJson = api.getCardList()
        self.failUnless('cardList' in cardJson, 'No card list')
Пример #2
0
def activation_handler(sender, user, request, **kwargs):
    logging.info('Got user activated signal!!')
    if not user:
        logging.error('No user??')
        return
    
    email = getattr(user, 'email')
    logging.info('Got email: %s', email)
    
    expensify = Expensify()
    expensify.createAccount(email)