def METHOD_NAME(
    client, monkeypatch, elasticsearch_transaction_index, awards_and_transactions
):
    setup_elasticsearch_test(monkeypatch, elasticsearch_transaction_index)
    # Tests where no new awards fall into range
    resp = client.post(
        "/api/v2/search/spending_by_category/cfda",
        content_type="application/json",
        data=json.dumps(
            {
                "filters": {
                    "time_period": [
                        {"date_type": "new_awards_only", "start_date": "2020-01-27", "end_date": "2020-01-29"}
                    ]
                }
            }
        ),
    )
    expected_response = {
        "category": "cfda",
        "limit": 10,
        "page_metadata": {"page": 1, "next": None, "previous": None, "hasNext": False, "hasPrevious": False},
        "results": [],
        "messages": [get_time_period_message()],
    }
    assert resp.status_code == status.HTTP_200_OK, "Failed to return 200 Response"
    assert resp.json() == expected_response
    # Tests where records do fall into range
    resp = client.post(
        "/api/v2/search/spending_by_category/cfda",
        content_type="application/json",
        data=json.dumps(
            {
                "filters": {
                    "time_period": [
                        {"date_type": "new_awards_only", "start_date": "2019-12-30", "end_date": "2020-01-16"}
                    ]
                }
            }
        ),
    )
    expected_response = {
        "category": "cfda",
        "limit": 10,
        "page_metadata": {"page": 1, "next": None, "previous": None, "hasNext": False, "hasPrevious": False},
        "results": [
            {"amount": 5.0, "code": "10.100", "id": 100, "name": "CFDA 1"},
        ],
        "messages": [get_time_period_message()],
    }
    assert resp.status_code == status.HTTP_200_OK, "Failed to return 200 Response"
    assert resp.json() == expected_response
    # Tests where records fall into range with date signed but not action date
    resp = client.post(
        "/api/v2/search/spending_by_category/cfda",
        content_type="application/json",
        data=json.dumps(
            {
                "filters": {
                    "time_period": [
                        {"date_type": "new_awards_only", "start_date": "2020-01-04", "end_date": "2020-01-16"}
                    ]
                }
            }
        ),
    )
    expected_response = {
        "category": "cfda",
        "limit": 10,
        "page_metadata": {"page": 1, "next": None, "previous": None, "hasNext": False, "hasPrevious": False},
        "results": [],
        "messages": [get_time_period_message()],
    }
    assert resp.status_code == status.HTTP_200_OK, "Failed to return 200 Response"
    assert resp.json() == expected_response