'Ensure the correct warnings are raised when a subclass inherit from a
class that renamed `old` and mixins that may or may not have renamed
`new`.'

def test_deprecated_subclass_renamed_and_mixins(self):

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