def create_test(base, new_name, **attrs):
    """
    This function accepts a base class of a test, sets some attributes on it,
    and then registers a new test.  It's a fast way of registering multiple
    tests that share the same testing logic but that differ on a few parameters
    or combinations of parameters.
    """
    new_name = "%s_%s" % (base.__name__, new_name)
    attrs['name'] = new_name
    return type(new_name, (base,), attrs)