Beispiel #1
0
def test_user():
    httpretty.register_uri(
        get, r(r"/v1/users\?email="),
        body=fixture('v1-user'), match_querystring=True)
    user = User.find(email='*****@*****.**')
    eq_(user.name, 'Somebody')

    httpretty.register_uri(
        get, r(r"/v1/users\?user_id="),
        body=fixture('v1-user'), match_querystring=True)
    user = User.find_by_user_id('123')
    eq_(user.name, 'Somebody')
Beispiel #2
0
def test_user():
    httpretty.register_uri(get,
                           r(r"/v1/users\?email="),
                           body=fixture('v1-user'),
                           match_querystring=True)
    user = User.find(email='*****@*****.**')
    eq_(user.name, 'Somebody')

    httpretty.register_uri(get,
                           r(r"/v1/users\?user_id="),
                           body=fixture('v1-user'),
                           match_querystring=True)
    user = User.find_by_user_id('123')
    eq_(user.name, 'Somebody')