def METHOD_NAME(
    self, svc, user, pyramid_request
):
    dupe_username = user.username
    with pytest.raises(
        DuplicateUserError,
        match=(f".*user with username '{dupe_username}' already exists"),
    ):
        svc.ensure_unique(
            {"username": dupe_username}, authority=pyramid_request.default_authority
        )