(case, repeater, startdate, enddate)
return len(transactions_in_daterange)
Based on a case's transactions, and the number of repeat records
Based on a case's transactions, and the number of repeat records
Based on a case s transactions and the number of repeat records
def expected_number_of_repeat_records_fired_for_case(case, repeater, startdate, enddate):
    """
    Based on a case's transactions, and the number of repeat records
    """
    filtered_transactions = []
    if isinstance(repeater, CreateCaseRepeater):
        # to avoid modifying CreateCaseRepeater's allowed_to_forward method
        if create_case_repeater_allowed_to_forward(repeater, case):
            filtered_transactions = case.transactions[0:1]
    elif isinstance(repeater, UpdateCaseRepeater):
        if repeater.allowed_to_forward(case):
            filtered_transactions = case.transactions[1:]
    else:
        if repeater.allowed_to_forward(case):
            filtered_transactions = case.transactions

    transactions_in_daterange = [transaction for transaction in filtered_transactions
                                 if startdate <= get_transaction_date(transaction) <= enddate]

    return len(transactions_in_daterange)
def expected_number_of_repeat_records_fired_for_case ( case , repeater , startdate , enddate ) : filtered_transactions = [ ] if isinstance ( repeater , CreateCaseRepeater ) : # to avoid modifying CreateCaseRepeater's allowed_to_forward method if create_case_repeater_allowed_to_forward ( repeater , case ) : filtered_transactions = case . transactions [ 0 : 1 ] elif isinstance ( repeater , UpdateCaseRepeater ) : if repeater . allowed_to_forward ( case ) : filtered_transactions = case . transactions [ 1 : ] else : if repeater . allowed_to_forward ( case ) : filtered_transactions = case . transactions transactions_in_daterange = [ transaction for transaction in filtered_transactions if startdate <= get_transaction_date ( transaction ) <= enddate ] return len ( transactions_in_daterange )