def METHOD_NAME():
    """
    Test linkage management command for records that have both a piid and parent piid
    """
    models_to_mock = [
        {"model": AwardSearch, "award_id": 999, "piid": "RANDOM_PIID", "parent_award_piid": "RANDOM_PARENT_PIID"},
        {"model": AwardSearch, "award_id": 1999, "piid": "RANDOM_PIID_2", "parent_award_piid": None},
        {
            "model": FinancialAccountsByAwards,
            "financial_accounts_by_awards_id": 777,
            "piid": "RANDOM_PIID",
            "parent_award_id": "RANDOM_PARENT_PIID",
        },
        {
            "model": FinancialAccountsByAwards,
            "financial_accounts_by_awards_id": 1777,
            "piid": "RANDOM_PIID_2",
            "parent_award_id": None,
        },
    ]
    for entry in models_to_mock:
        baker.make(entry.pop("model"), **entry)
    # use the award_search table because the award_search_temp table is not present in testing
    call_command("update_file_c_linkages", "--recalculate-linkages", "--file-d-table=award_search")
    expected_results = {
        "award_ids": [999, 1999],
        "piids": ["RANDOM_PIID", "RANDOM_PIID_2"],
        "parent_piids": ["RANDOM_PARENT_PIID", None],
    }
    award_ids = list(FinancialAccountsByAwards.objects.order_by("award_id").values_list("award_id", flat=True))
    actual_results = {
        "award_ids": award_ids,
        "piids": list(Award.objects.filter(id__in=award_ids).order_by("id").values_list("piid", flat=True)),
        "parent_piids": list(
            Award.objects.filter(id__in=award_ids).order_by("id").values_list("parent_award_piid", flat=True)
        ),
    }
    assert expected_results == actual_results