def get_test_cases(request, run_id):
    """Get the list of cases that this run is linked to.

    :param int run_id: run ID.
    :return: a list of mappings of found :class:`TestCase`.
    :rtype: list[dict]

    Example::

        TestRun.get_test_cases(1)
    """
    tcs_serializer = TestCase.to_xmlrpc(query={"case_run__run_id": run_id})

    qs = TestCaseRun.objects.filter(run_id=run_id).values("case", "pk", "case_run_status__name")
    extra_info = {row["case"]: row for row in qs.iterator()}

    for case in tcs_serializer:
        info = extra_info[case["case_id"]]
        case["case_run_id"] = info["pk"]
        case["case_run_status"] = info["case_run_status__name"]

    return tcs_serializer