@require_GET
@require_uth_domain
@login_or_basic
def pending_exams(request, domain, scanner_serial, **kwargs):

    if not scanner_serial:
        response_data = {}
        response_data['result'] = 'failed'
        response_data['message'] = 'Missing scanner serial'
        return HttpResponse(json.dumps(response_data), content_type="application/json")

    results = CommCareCase.get_db().view(
        'uth/uth_lookup',
        startkey=[UTH_DOMAIN, scanner_serial],
        endkey=[UTH_DOMAIN, scanner_serial, {}],
    ).all()

    exam_ids = [r['key'][-1] for r in results]

    response_data = {}
    response_data['result'] = 'success'
    response_data['exam_ids'] = exam_ids
    return HttpResponse(json.dumps(response_data), content_type="application/json")
Test whether a proper dependency tree generated the correct output.
dataset/ETHPy150Open dimagi/commcare-hq/custom/uth/views.py/pending_exams--crossover with--dataset/ETHPy150Open toumorokoshi/sprinter/sprinter/lib/tests/test_dependencytree.py/TestDependencyTree.test_proper_tree