Ejemplo n.º 1
0
def test_update_billing_info():
    user = User.get_by_email("*****@*****.**")
    user.customer_id = '-1'
    user.subscription_id = '-1'
    user.save()
    info = {
        'first_name':'Bob',
        'last_name':'Jones',
        'addr1':'1234 Fast Lane',
        'addr2':'',
        'city':'San Francisco',
        'state':'CA',
        'zip':'94103',
        'expiration_month':'05',
        'expiration_year':'2015',
        'cc_number':'1',
        'cvv':'734'
    }
    
    assert (user.customer_id == '-1')
    assert (user.subscription_id == '-1')
    update_billing_info("*****@*****.**", info)
    user = User.get_by_email("*****@*****.**")
    assert (user.customer_id != '-1')
    assert (user.subscription_id != '-1')
Ejemplo n.º 2
0
def test_update_billing_info():
    user = User.get_by_email("*****@*****.**")
    user.customer_id = '-1'
    user.subscription_id = '-1'
    user.save()
    info = {
        'first_name': 'Bob',
        'last_name': 'Jones',
        'addr1': '1234 Fast Lane',
        'addr2': '',
        'city': 'San Francisco',
        'state': 'CA',
        'zip': '94103',
        'expiration_month': '05',
        'expiration_year': '2015',
        'cc_number': '1',
        'cvv': '734'
    }

    assert (user.customer_id == '-1')
    assert (user.subscription_id == '-1')
    update_billing_info("*****@*****.**", info)
    user = User.get_by_email("*****@*****.**")
    assert (user.customer_id != '-1')
    assert (user.subscription_id != '-1')
Ejemplo n.º 3
0
def main(email, password):
    try:
        user = User.get_by_email(email)
        user.passwd = hash_password(email, password)
        user.save()
    except Exception as e:
        print "Exception: %s" % e

    print "Success."
Ejemplo n.º 4
0
def main(email, password):
    try:
        user = User.get_by_email(email)
        user.passwd = hash_password(email, password)
        user.save()
    except Exception as e:
        print "Exception: %s" % e

    print "Success."