Пример #1
0
def test_gc_legacy_current_json(session):
    """Assert that the financing statement JSON contains expected general collateral."""
    result = FinancingStatement.find_by_id(200000012)
    result.mark_update_json = False
    result.current_view_json = True
    json_data = result.json
    # print(json_data)
    assert len(json_data['generalCollateral']) >= 4
    for collateral in json_data['generalCollateral']:
        assert 'collateralId' in collateral
        assert 'addedDateTime' in collateral
        # print(collateral)
        if collateral['collateralId'] in (200000004, 200000005, 200000006):
            assert collateral['description']
            assert 'descriptionAdd' not in collateral
            assert 'descriptionDelete' not in collateral
        if collateral['collateralId'] == 200000007:
            assert collateral['descriptionAdd']
            assert 'descriptionDelete' not in collateral
            assert 'description' not in collateral
        if collateral['collateralId'] == 200000008:
            assert collateral['descriptionDelete']
            assert 'descriptionAdd' not in collateral
            assert 'description' not in collateral
        if collateral['collateralId'] == 200000009:
            assert collateral['descriptionAdd']
            assert collateral['descriptionDelete']
            assert 'description' not in collateral
Пример #2
0
def test_gc_legacy_json(session):
    """Assert that the financing statement JSON contains expected general collateral."""
    result = FinancingStatement.find_by_id(200000012)
    result.mark_update_json = False
    result.current_view_json = False
    json_data = result.json
    # print(json_data)
    assert len(json_data['generalCollateral']) == 3
    for collateral in json_data['generalCollateral']:
        assert 'collateralId' in collateral
        assert 'addedDateTime' in collateral
        assert 'description' in collateral
        assert 'descriptionAdd' not in collateral
        assert 'descriptionDelete' not in collateral
Пример #3
0
def test_find_by_id(session):
    """Assert that find financing statement by ID contains all expected elements."""
    result = FinancingStatement.find_by_id(200000000)
    assert result
    assert result.registration_num
    if result:
        json_data = result.json
        assert json_data['type'] == 'SA'
        assert json_data['baseRegistrationNumber'] == 'TEST0001'
        assert json_data['registeringParty']
        assert json_data['createDateTime']
        assert json_data['debtors'][0]
        assert json_data['securedParties'][0]
        assert json_data['generalCollateral'][0]
        assert json_data['vehicleCollateral'][0]
Пример #4
0
def test_current_json(session):
    """Assert that financing statement JSON contains expected current view elements."""
    result = FinancingStatement.find_by_id(200000000)
    result.mark_update_json = True
    result.current_view_json = True
    json_data = result.json
    assert len(json_data['debtors']) >= 2
    assert len(json_data['securedParties']) >= 2
    assert len(json_data['generalCollateral']) >= 2
    assert len(json_data['vehicleCollateral']) >= 2
    assert 'added' in json_data['debtors'][1]
    assert 'added' in json_data['securedParties'][1]
    assert 'added' not in json_data['generalCollateral'][1]
    assert 'added' in json_data['vehicleCollateral'][1]
    assert json_data['debtors'][1]['added']
    assert json_data['securedParties'][1]['added']
    assert json_data['vehicleCollateral'][1]['added']