Exemplo n.º 1
0
def handleSignUp():
    '''
    A function that will handle our signup for a new user
    '''
    result = "login"

    println('Sign Up')

    while True:
        username = read('Username')

        if len(username) == 0:
            print_error(
                "Empty username is not allowed. Please enter valid username.")
        if User.user_exist(username) == True:
            print_error(
                "The username {0} is already taken. Please enter another name."
                .format(username))
        else:
            break

    while True:
        password = read('Password')

        if len(password) == 0:
            print_error(
                "Empty password is not allowed. Please enter valid password.")
        else:
            break

    user = User(username, password)

    save_user(user)

    return result
Exemplo n.º 2
0
    def test_user_exists(self):
        '''
        test to check if we can return a boolean if cannot find the contact.
        '''
        self.new_user.save_user()
        test_user = User("Roman", "Facebook", "@roman.com", "reigns18")
        test_user.save_user()

        user_exists = User.user_exist("Facebook")
        self.assertTrue(user_exists)
Exemplo n.º 3
0
    def test_users_exists(self):
        '''
        returns boolean if users not found test
        '''
        self.new_user.save_user()
        test_user  = User("test_user","password",)

        test_user.save_user()
        user_exists = User.user_exist("test")
        
        self.assertTrue(user_exists)
Exemplo n.º 4
0
    def test_user_exists(self):
        '''
        test to check if we can return a Boolean if we cannot find the user.
        '''

        self.new_user.save_user()
        test_user = User("Test", "user", "0711223344", "test@user")  #new user
        test_user.save_user()

        user_exists = User.user_exist("0711223344")
        self.assertTrue(user_exists)
Exemplo n.º 5
0
    def test_user_exists(self):
        '''
        test to check if we can return a Boolean  if we cannot find the user.
        '''

        self.new_user.save_user()
        test_user = User("feven", "a1b1c1")  # new user
        test_user.save_user()

        user_exists = User.user_exist("feven")

        self.assertTrue(user_exists)
Exemplo n.º 6
0
def check_existing_user(account_name):
    '''
    Function that check if a user exists
    '''
    return User.user_exist(account_name)
Exemplo n.º 7
0
def check_existing_users(number):
    '''
    Function that check if a user exists with that number and return a Boolean
    '''
    return User.user_exist(number)
Exemplo n.º 8
0
def verify_user(lunam,upassword):
	'''
	Function that verifies the existance of the user before creating credentials
	'''
	checking_user = User.user_exist(lunam,upassword)
	return checking_user