Example #1
0
def register_user():
    if handle_authentication(request.form):
        teacher_username = get_username(request.form["token"])
        instance         = User(teacher_username, PATH + "/userman")
        college_group    = instance.college().group_name
        first_name       = request.form["first_name"].strip()
        last_name        = request.form["last_name"].strip()
        email            = request.form["email"].strip()
        team             = request.form["team"].strip()
        helpers.register_user(teacher_username, college_group, first_name, last_name, email, team)
        return "", 200
    return "", 403
Example #2
0
 def test_register_many_users(self):
     n = random.randint(30, 100)
     for i in xrange(0,n):
         helpers.register_user("ab", "1", "sam", "phippen", "*****@*****.**", "1")
     self.assertEqual(len(get_registrations()), n)
Example #3
0
 def test_register_user(self):
     helpers.register_user("ab", "1", "sam", "phippen", "*****@*****.**", "1")
     self.assertEqual(len(get_registrations()), 1)