Ejemplo n.º 1
0
def get_user(user_id):
    """

    """
    try:
        uobj = usermodel.get_user(user_id)
    except err.Rhaptos2Error, e:
        abort(404)
Ejemplo n.º 2
0
def test_putuser():

    d = {"user_id": "org.cnx.user-75e06194-baee-4395-8e1a-566b656f6920",
         "email": "wibbleemail", 
         "version": "1.0", 
         "fullname": "wibblename"}

    u = usermodel.put_user(d, "org.cnx.user-75e06194-baee-4395-8e1a-566b656f6920")
    
    assert u.fullname == "wibblename"
    db_session.add(u); db_session.commit()    
    u_fromdb = usermodel.get_user("org.cnx.user-75e06194-baee-4395-8e1a-566b656f6920")
    assert u_fromdb.fullname == "wibblename"    
Ejemplo n.º 3
0
def test_putuser():
#    d = {"interests": null, "identifiers": [{"identifierstring": "https://paulbrian.myopenid.com", "user_id": "org.cnx.user-75e06194-baee-4395-8e1a-566b656f6920", "identifiertype": "openid"}], "user_id": "org.cnx.user-75e06194-baee-4395-8e1a-566b656f6920", "suffix": null, "firstname": null, "title": null, "middlename": null, "lastname": null, "imageurl": null, "otherlangs": null, "affiliationinstitution_url": null, "email": null, "version": null, "location": null, "recommendations": null, "preferredlang": null, "fullname": "Paul Brian", "homepage": null, "affiliationinstitution": null, "biography": null}

    d = {"user_id": "org.cnx.user-75e06194-baee-4395-8e1a-566b656f6920",
         "email": "wibbleemail", 
         "version": "1.0", 
         "fullname": "wibblename"}

    u = usermodel.put_user(d, "org.cnx.user-75e06194-baee-4395-8e1a-566b656f6920")
    
    assert u.fullname == "wibblename"
    db_session.add(u); db_session.commit()    
    u_fromdb = usermodel.get_user("org.cnx.user-75e06194-baee-4395-8e1a-566b656f6920")
    assert u_fromdb.fullname == "wibblename"    
Ejemplo n.º 4
0
def test_retrieve_known_user_id():
    uobj = usermodel.get_user(
              "org.cnx.user-75e06194-baee-4395-8e1a-566b656f6920")
    assert uobj.fullname == 'Paul Brian'