예제 #1
0
def test_fee_schedule_with_service_fees_for_basic_user(session):
    """Assert that fee with service fees can be retrieved."""
    # Create a transaction fee
    tran_fee_code = 'TRAN'
    corp_type_code = 'XCORP'
    fee_code = 'FEE01'
    fee_code_master = FeeCode(code=tran_fee_code, amount=10)
    fee_code_master.save()

    fee_code_master = FeeCode(code=fee_code, amount=100)
    fee_code_master.save()

    corp_type = CorpType(code=corp_type_code,
                         service_fee_code=tran_fee_code,
                         description='TEST')
    corp_type.save()

    filing_type = FilingType(code=FILING_TYPE_CODE, description='TEST')
    filing_type.save()

    fee_schedule = services.FeeSchedule()
    fee_schedule.filing_type_code = FILING_TYPE_CODE
    fee_schedule.corp_type_code = corp_type_code
    fee_schedule.fee_code = fee_code
    fee_schedule.fee_start_date = date.today()
    fee_schedule.save()

    fee_schedule = services.FeeSchedule.find_by_corp_type_and_filing_type(
        corp_type=corp_type_code,
        filing_type_code=FILING_TYPE_CODE,
        valid_date=date.today(),
        include_service_fees=False)
    assert fee_schedule.service_fees == 10
예제 #2
0
def create_linked_data(
        filing_type_code: str,
        corp_type_code: str,
        fee_code: str,
        priority_fee: str = None,
        future_effective_fee: str = None):
    """Return a valid fee schedule object, creates the related objects first."""
    corp_type = CorpType(code=corp_type_code,
                         description='TEST')
    corp_type.save()

    fee_code_master = FeeCode(code=fee_code,
                              amount=100)
    fee_code_master.save()

    if priority_fee:
        priority_fee_code = FeeCode(code=priority_fee,
                                    amount=10)
        priority_fee_code.save()
    if future_effective_fee:
        future_effective_fee_code = FeeCode(code=future_effective_fee,
                                            amount=20)
        future_effective_fee_code.save()

    filing_type = FilingType(code=filing_type_code,
                             description='TEST')
    filing_type.save()
예제 #3
0
def factory_filing_type_model(filing_type_code: str,
                              filing_description: str = 'TEST'):
    """Return the filing type model."""
    filing_type = FilingType(code=filing_type_code,
                             description=filing_description)
    filing_type.save()
    return filing_type
예제 #4
0
def create_linked_data(filing_type_code: str, corp_type_code: str,
                       fee_code: str):
    """Return a valid fee schedule object, creates the related objects first."""
    corp_type = CorpType(code=corp_type_code, description='TEST')
    corp_type.save()

    fee_code_master = FeeCode(code=fee_code, amount=100)
    fee_code_master.save()

    filing_type = FilingType(code=filing_type_code, description='TEST')
    filing_type.save()