'Add a callback while needing validation.'

def test_add_validation(self):

    author = self.char1
    self.handler.add_callback(self.room1, 'dummy', 'character.db.strength    =    40', author=author, valid=False)
    callback = self.handler.get_callbacks(self.room1).get('dummy')
    callback = callback[0]
    self.assertIsNotNone(callback)
    self.assertEqual(callback['author'], author)
    self.assertEqual(callback['valid'], False)
    self.assertIn((self.room1, 'dummy', 0), self.handler.db.to_valid)
    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, 10)
