def METHOD_NAME(self, svc, user, pyramid_request):
    dupe_identity = {
        "provider": user.identities[0].provider,
        "provider_unique_id": user.identities[0].provider_unique_id,
    }
    with pytest.raises(DuplicateUserError, match=".*email.*username.*provider"):
        svc.ensure_unique(
            {
                "email": user.email,
                "username": user.username,
                "identities": [dupe_identity],
            },
            authority=pyramid_request.default_authority,
        )