'Ensure the correct warnings are raised when a class that didn\'t rename
`old` subclass one that did.'

def test_deprecated_subclass_renamed(self):

    with warnings.catch_warnings(record=True) as recorded:
        warnings.simplefilter(u'ignore')
        class Renamed(six.with_metaclass(RenameManagerMethods), ):
            def new(self):
                pass
        class Deprecated(Renamed, ):
            def old(self):
                super(Deprecated, self).old()
        warnings.simplefilter(u'always')
        deprecated = Deprecated()
        deprecated.new()
        self.assertEqual(len(recorded), 1)
        msg = str(recorded.pop().message)
        self.assertEqual(msg, u'`Renamed.old`    is    deprecated,    use    `new`    instead.')
        recorded[:] = []
        deprecated.old()
        self.assertEqual(len(recorded), 2)
        msgs = [str(warning.message) for warning in recorded]
        self.assertEqual(msgs, [u'`Deprecated.old`    is    deprecated,    use    `new`    instead.', u'`Renamed.old`    is    deprecated,    use    `new`    instead.'])
