Ejemplo n.º 1
0
def test_find_by_registration_id(session):
    """Assert that find general collateral by registration id contains all expected elements."""
    collateral = GeneralCollateralLegacy.find_by_registration_id(200000024)
    assert collateral and len(collateral) == 3
    for gen_coll in collateral:
        assert gen_coll.id
        assert gen_coll.registration_id == 200000024
        assert gen_coll.financing_id == 200000012
        assert gen_coll.description
Ejemplo n.º 2
0
def test_general_collateral_delete_json(session):
    """Assert that the general collateral model renders delete collateral json format correctly."""
    collateral = GeneralCollateralLegacy(id=1000,
                                         description='TEST DELETE',
                                         status='D')

    collateral_json = {
        'collateralId': collateral.id,
        'descriptionDelete': collateral.description,
        'addedDateTime': ''
    }
    assert collateral.current_json == collateral_json
Ejemplo n.º 3
0
def test_find_by_id(session):
    """Assert that find general collateral by collateral ID contains all expected elements."""
    collateral = GeneralCollateralLegacy.find_by_id(200000004)
    assert collateral
    assert collateral.id == 200000004
    assert collateral.registration_id == 200000024
    assert collateral.financing_id == 200000012
    assert collateral.description
    assert not collateral.registration_id_end
    json_data = collateral.json
    assert json_data['collateralId'] == 200000004
    assert json_data['description'] == 'TEST0018 GC 1'
Ejemplo n.º 4
0
def test_general_collateral_json(session):
    """Assert that the general collateral model renders to a json format correctly."""
    collateral = GeneralCollateralLegacy(
        id=1000,
        description='TEST',
    )

    collateral_json = {
        'collateralId': collateral.id,
        'description': collateral.description,
        'addedDateTime': ''
    }
    # print(collateral.json)
    assert collateral.json == collateral_json
    assert collateral.current_json == collateral_json
Ejemplo n.º 5
0
def test_find_by_reg_id_invalid(session):
    """Assert that find general collateral by non-existent registration ID returns the expected result."""
    collateral = GeneralCollateralLegacy.find_by_registration_id(300000000)
    assert not collateral
Ejemplo n.º 6
0
def test_find_by_financing_id_invalid(session):
    """Assert that find general collateral by non-existent financing statement ID returns the expected result."""
    collateral = GeneralCollateralLegacy.find_by_financing_id(300000000)
    assert not collateral