Esempio n. 1
0
 def test_validate_user_dict_3(self):
     user = {
         "first_name": "John",
         "last_name": "Smith",
         "username": "******"
     }
     self.assertFalse(MasterPi.validate_user_dict(user))
Esempio n. 2
0
 def test_validate_user_dict_5(self):
     user = {
         "last_name": "Smith",
         "email": "*****@*****.**",
         "username": "******"
     }
     self.assertFalse(MasterPi.validate_user_dict(user))
Esempio n. 3
0
 def test_validate_user_dict_2(self):
     user = {
         "first_name": "John",
         "last_name": "Smith",
         "email": "*****@*****.**"
     }
     self.assertFalse(MasterPi.validate_user_dict(user))
Esempio n. 4
0
 def test_update_or_add_user_1(self):
     # Test user add
     user = {
         "first_name": "John",
         "last_name": "Smith",
         "email": "*****@*****.**",
         "username": "******"
     }
     test_db = "lms_library_config_test.json"
     db = LMSLibraryDatabase(test_db)
     user_list = list()
     user_list.append(user["username"])
     user_list.append(user["first_name"])
     user_list.append(user["last_name"])
     user_list.append(user["email"])
     MasterPi.update_or_add_user(test_db, user)
     db_user = db.get_user(user["username"])
     self.assertTupleEqual(tuple(user_list), db_user[0])
Esempio n. 5
0
 def test_validate_user_dict_6(self):
     user = {}
     self.assertFalse(MasterPi.validate_user_dict(user))