Example #1
0
def test_get_roles():  # type: () -> None
    role = leancloud.Role('xxx')
    role.save()

    user = User()
    user.login('user1_name', 'password')
    role.get_users().add(user)
    role.save()
    bind_roles = user.get_roles()
    assert len(bind_roles) == 1
    assert bind_roles[0].get('name') == 'xxx'

    role.destroy()
Example #2
0
def test_get_roles(): # type: () -> None
    role = leancloud.Role('xxx')
    role.save()

    user = User()
    user.login('user1_name', 'password')
    role.get_users().add(user)
    role.save()
    bind_roles = user.get_roles()
    assert len(bind_roles) == 1
    assert bind_roles[0].get('name') == 'xxx'

    role.destroy()
Example #3
0
def test_get_roles():  # type: () -> None
    role = leancloud.Role("xxx")
    role.save()

    user = User()
    user.login("user1_name", "password")
    role.get_users().add(user)
    role.save()
    bind_roles = user.get_roles()
    assert len(bind_roles) == 1
    assert bind_roles[0].get("name") == "xxx"

    role.destroy()