Example #1
0
def test_change_phone_number():  # type: () -> None
    try:
        # phone number is from http://www.z-sms.com
        User.change_phone_number("196784", "+8617180655340")
    except LeanCloudError as e:
        if e.code != 603:
            raise e
    else:
        user1 = User()
        user1.set("username", "py_test_change_phone")
        user1.set("password", "password")
        user1.login()
        assert user1.get_mobile_phone_number() == "+8617180655340"
        user1.destroy()
Example #2
0
def test_get_methods():
    user = User()
    user.login('user1_name', 'password')

    user.set_username('new_user1')
    assert user.get_username() == 'new_user1'

    user.set_mobile_phone_number('18611111111x')
    assert user.get_mobile_phone_number() == '18611111111x'

    user.set_password('new_password')
    assert user._attributes.get('password') == 'new_password'

    user.set_email('*****@*****.**')
    assert user.get_email() == '*****@*****.**'
Example #3
0
def test_get_methods():
    user = User()
    user.login('user1_name', 'password')

    user.set_username('new_user1')
    assert user.get_username() == 'new_user1'

    user.set_mobile_phone_number('18611111111x')
    assert user.get_mobile_phone_number() == '18611111111x'

    user.set_password('new_password')
    assert user._attributes.get('passWord') == 'new_password'

    user.set_email('*****@*****.**')
    assert user.get_email() == '*****@*****.**'
Example #4
0
def test_get_methods():  # type: () -> None
    user = User()
    user.login("user1_name", "password")

    user.set_username("new_user1")
    assert user.get_username() == "new_user1"

    user.set_mobile_phone_number("18611111111x")
    assert user.get_mobile_phone_number() == "18611111111x"

    user.set_password("new_password")
    assert user._attributes.get("password") == "new_password"

    user.set_email("*****@*****.**")
    assert user.get_email() == "*****@*****.**"