示例#1
0
 def test_good_hashed(self, update_mock: mock.Mock):
     users.update_password(USR, PWD, 'new_pwd')
     update_mock.assert_called()
     new_pwd_input = update_mock.call_args[0][1]['password']
     self.assertNotEqual(new_pwd_input, 'new_pwd')
示例#2
0
 def test_wrong_password(self, update_mock: mock.Mock):
     with self.assertRaises(exceptions.ForbiddenException):
         users.update_password(USR, 'wrong_pwd', 'new_pwd')
     update_mock.assert_not_called()
示例#3
0
 def test_bad_new_password(self, update_mock: mock.Mock):
     with self.assertRaises(exceptions.BadRequestException):
         users.update_password(USR, 'wrong_pwd', 'new_pwd')
     update_mock.assert_not_called()
示例#4
0
 def test_not_found(self, update_mock: mock.Mock):
     with self.assertRaises(exceptions.NotFoundException):
         users.update_password(USR, 'pwd', 'new_pwd')