Exemplo n.º 1
0
def actually_create_account_page():
    """Makes post requests to get user input to create an account. """

    email_in = request.form.get("email")
    password_in = request.form.get("password")
    settings_in = request.form.get("settings")    

    password_in_s_h = sha256_crypt.encrypt(password_in)
    adduser = model.create_user_account(email=email_in, password=password_in_s_h, settings=settings_in)

    flash (adduser)

    if adduser == "Successfully Added!":
        return render_template("index.html")
    else:
        return redirect(url_for("display_create_account_page"))
Exemplo n.º 2
0
 def testShouldReturnPleaseFillOutAllFields(self):
     """no email test on create_user_account"""
     self.assertEqual(model.create_user_account("", "password"),
                      "Please Fill Out All Fields")
Exemplo n.º 3
0
 def testShouldReturnSuccessfullyAdded(self):
     """adds new fake user"""
     fakeemail = "test@" + str(random.randint(0, 1000)) + str(
         random.randint(1000, 4000)) + ".com"
     self.assertEqual(model.create_user_account(fakeemail, "testpw"),
                      "Successfully Added!")
Exemplo n.º 4
0
 def testShouldReturnUserAlreadyExist(self):
     """tests for inserting a new user"""
     shpw = '$5$rounds=110000$Nuh.QHEOksPjQUyj$2qAPC1KZNNYwRMjUC9UHTgZi0rkEWQkurJZj.R9BzxD'
     self.assertEqual(model.create_user_account("*****@*****.**", shpw),
                      "User Already Exists.")
Exemplo n.º 5
0
 def testShouldReturnPleaseFillOutAllFields2(self):
     """no pw test on create_user_account"""
     self.assertEqual(model.create_user_account("email", ""),
                      "Please Fill Out All Fields")
Exemplo n.º 6
0
 def testShouldReturnPleaseFillOutAllFields(self):
     """no email test on create_user_account"""
     self.assertEqual(model.create_user_account("", "password"), "Please Fill Out All Fields")
Exemplo n.º 7
0
 def testShouldReturnSuccessfullyAdded(self):
     """adds new fake user"""
     fakeemail = "test@" + str(random.randint(0, 1000)) + str(random.randint(1000, 4000)) + ".com"
     self.assertEqual(model.create_user_account(fakeemail, "testpw"), "Successfully Added!")
Exemplo n.º 8
0
 def testShouldReturnUserAlreadyExist(self):
     """tests for inserting a new user"""
     shpw = "$5$rounds=110000$Nuh.QHEOksPjQUyj$2qAPC1KZNNYwRMjUC9UHTgZi0rkEWQkurJZj.R9BzxD"
     self.assertEqual(model.create_user_account("*****@*****.**", shpw), "User Already Exists.")
Exemplo n.º 9
0
 def testShouldReturnPleaseFillOutAllFields2(self):
     """no pw test on create_user_account"""
     self.assertEqual(model.create_user_account("email", ""), "Please Fill Out All Fields")