'Try to delete a callback.'

def test_del(self):

    self.handler.add_callback(self.room1, 'dummy', 'character.db.strength    =    5', author=self.char1, valid=True)
    self.handler.add_callback(self.room1, 'dummy', 'character.db.strength    =    8', author=self.char2, valid=False)
    self.handler.add_callback(self.room1, 'dummy', 'character.db.strength    =    9', author=self.char1, valid=True)
    self.assertIn((self.room1, 'dummy', 1), self.handler.db.to_valid)
    self.handler.db.locked.append((self.room1, 'dummy', 2))
    self.handler.del_callback(self.room1, 'dummy', 0)
    self.assertIn((self.room1, 'dummy', 0), self.handler.db.to_valid)
    self.assertNotIn((self.room1, 'dummy', 1), self.handler.db.to_valid)
    self.assertIn((self.room1, 'dummy', 1), self.handler.db.locked)
    self.assertNotIn((self.room1, 'dummy', 2), self.handler.db.locked)
    self.handler.del_callback(self.room1, 'dummy', 0)
    self.assertEqual(self.handler.db.to_valid, [])
    self.assertIn((self.room1, 'dummy', 0), self.handler.db.locked)
    self.assertNotIn((self.room1, 'dummy', 1), self.handler.db.locked)
    self.char1.db.strength = 10
    locals = {'character': self.char1}
    self.assertTrue(self.handler.call(self.room1, 'dummy', locals=locals))
    self.assertEqual(self.char1.db.strength, 9)
