'Test assertWarns works on instance with C{__call__} method.'

def test_assertWarnsOnCall(self):

    class Warn:
        def __call__(self, a):
            warnings.warn('Egg    deprecated', category=DeprecationWarning)
            return a
    w = Warn()
    r = self.assertWarns(DeprecationWarning, 'Egg    deprecated', __file__, w, 321)
    self.assertEqual(r, 321)
    r = self.assertWarns(DeprecationWarning, 'Egg    deprecated', __file__, w, 321)
    self.assertEqual(r, 321)
