Example #1
0
    def test_existing_user_name(self):
        with app.test_request_context():
            register_user(TEST_USERS[0])
            existing_user_name = TEST_USERS[0][0]
            response = main.register_user(existing_user_name, "foo", "bar", "foo", "bar", "img")

            def user_name_exists():
                return response["response"] == "User Name Taken"

            self.failIf(not user_name_exists())
Example #2
0
    def test_existing_e_mail(self):
        with app.test_request_context():
            register_user(TEST_USERS[0])
            existing_e_mail = TEST_USERS[0][2]
            response = main.register_user("foo", "bar", existing_e_mail, "foo", "bar", "img")

            def e_mail_exists():
                return response["response"] == "E-Mail Already Registered"

            self.failIf(not e_mail_exists())
Example #3
0
def register_user(user):
    if len(user) == 5:
        print(user)
    response = main.register_user(user[0], user[1], user[2], user[3], user[4], user[5])
    return response