Ejemplo n.º 1
0
 def test_60_addUser(self):
     UserOperations.add('17605123977', 'muffin', 'nopassword')
     users = User.objects(phone='17605123977')
     self.assertEqual(len(users), 1)
     self.assertEqual(users[0].username, 'muffin')
     UserTests.saved_id = users[0].id
     UserTests.saved_password = users[0].password
Ejemplo n.º 2
0
 def test_65_deleteUser(self):
     UserOperations.delete('15850208731')
     users = User.objects(phone='15850208731')
     self.assertEqual(len(users), 0)
Ejemplo n.º 3
0
 def test_64_modifyPhone(self):
     UserOperations.modify_phone(UserTests.saved_id, '15850208731')
     users = User.objects(id=UserTests.saved_id)
     self.assertEqual(len(users), 1)
     self.assertEqual(users[0].phone, '15850208731')
Ejemplo n.º 4
0
 def test_63_verifyPassword(self):
     self.assertTrue(UserOperations.verify_password('17605123977', 'new_password'))
Ejemplo n.º 5
0
 def test_62_modifyPassword(self):
     UserOperations.modify_password('17605123977', 'new_password')
     users = User.objects(phone='17605123977')
     self.assertEqual(len(users), 1)
     self.assertNotEqual(users[0].password, UserTests.saved_password)
Ejemplo n.º 6
0
 def test_61_modifyUser(self):
     UserOperations.modify_user('17605123977', 'marvin', 'web/my.png')
     users = User.objects(phone='17605123977')
     self.assertEqual(len(users), 1)
     self.assertEqual(users[0].username, 'marvin')
     self.assertEqual(users[0].picture_path, 'web/my.png')
Ejemplo n.º 7
0
 def tearDownClass(cls):
     UserOperations.delete('17605123977')
     disconnect()
Ejemplo n.º 8
0
 def login(password):
     return UserOperations.verify_password(Admin.adminPhone, password)