def METHOD_NAME(
    make_organization_and_user_with_plugin_token, make_user_auth_headers, basename, viewset_class, action
):
    organization, user, token = make_organization_and_user_with_plugin_token()
    client = APIClient()
    url = reverse(f"api-internal:{basename}-{action.url_name}", kwargs={"pk": "NONEXISTENT"})
    with patch.object(viewset_class, "get_object", side_effect=NotFound) as mock_get_object:
        method = list(action.mapping.keys())[0]  # get the first allowed method
        response = client.generic(path=url, method=method, **make_user_auth_headers(user, token))
    """
    If you see this errors in tests, make sure to call self.get_object() in action method that's added / changed.
    Call to self.get_object() must come before any additional checks. For example, call to self.get_object() must come
    before checking for request data that may result in 400 Bad Request (i.e. check for 404 must come before check for 400).
    This is required to ensure all detail actions are safe, consistent with each other and easily testable.
    """
    assert response.status_code == status.HTTP_404_NOT_FOUND, "check for 404 must come before any additional checks"
    assert (
        mock_get_object.call_count == 1
    ), f"self.get_object() must be called in {viewset_class.__class__.__name__}.{action.__name__}"