def test_setting_mixin(mixin, **attrs):
    """Create a testable version of the setting mixin.

    The setting mixin passes through kwargs to an expected `super`
    object. When that object doesn't exist it causes errors. This
    function takes the mixin in question and adds that `super` object
    so that the mixin can be tested.
    """

    # The __init__ method for the parent object, so that it will accept
    # kwargs and store them so they can be tested.
    def __init__(self, **kwargs):
        self.kwargs = kwargs

    # Create the parent object for testing the setting mixin and return
    # the subclass of the mixin and the parent.
    parent = type('TestSettingMixin', (), {'__init__': __init__})
    return type('SettingMixin', (mixin, parent), attrs)