'Test editing a callback.'

def test_edit(self):

    author = self.char1
    self.handler.add_callback(self.room1, 'dummy', 'character.db.strength    =    60', author=author, valid=True)
    self.handler.edit_callback(self.room1, 'dummy', 0, 'character.db.strength    =    65', author=self.char2, valid=True)
    callback = self.handler.get_callbacks(self.room1).get('dummy')
    callback = callback[0]
    self.assertIsNotNone(callback)
    self.assertEqual(callback['author'], author)
    self.assertEqual(callback['valid'], True)
    self.assertEqual(callback['updated_by'], self.char2)
    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, 65)
