def test_set_dispatcher_creates_dispatcher_attribute(self):
     da = DispatcherAware()
     self.assertFalse(hasattr(da, 'dispatcher'))
     da.set_dispatcher(None)
     self.assertTrue(hasattr(da, 'dispatcher'))
     self.assertIsNone(da.dispatcher)
 def test_set_dispatcher_returns_instance_of_self(self):
     da = DispatcherAware()
     self.assertEqual(da.set_dispatcher(None), da)