Exemplo n.º 1
0
def test_hours_for_price():
    manifest = {
        "id": "Test",
        "type": "pricing",
        "fields": {
            "hours_for_price": "pfh"
        }
    }
    cq = ContentQuestion(manifest)
    result = pricing_property(cq)
    assert "enum" in result['pfh'].keys()
Exemplo n.º 2
0
def test_pricing_property_minmax_price():
    manifest = {
        "id": "Test",
        "type": "pricing",
        "fields": {
            "minimum_price": "priceMin",
            "maximum_price": "priceMax"
        }
    }
    cq = ContentQuestion(manifest)
    result = pricing_property(cq)
    assert not result['priceMin']['pattern'].startswith("^$|")
    assert not result['priceMax']['pattern'].startswith("^$|")
Exemplo n.º 3
0
def test_pricing_property_price_unit_and_interval():
    manifest = {
        "id": "Test",
        "type": "pricing",
        "fields": {
            "price_unit": "priceUnit",
            "price_interval": "priceInterval"
        }
    }
    cq = ContentQuestion(manifest)
    result = pricing_property(cq)
    assert type(result['priceInterval']['enum']) == list
    assert type(result['priceUnit']['enum']) == list
Exemplo n.º 4
0
def test_pricing_property_price_unit_and_interval_optional():
    manifest = {
        "id": "Test",
        "type": "pricing",
        "fields": {
            "price_unit": "priceUnit",
            "price_interval": "priceInterval"
        },
        "optional_fields": ["price_unit", "price_interval"]
    }
    cq = ContentQuestion(manifest)
    result = pricing_property(cq)
    assert "" in result['priceUnit']['enum']
    assert "" in result['priceInterval']['enum']
def test_pricing_property_price_unit_and_interval_optional():
    manifest = {
        "id": "Test",
        "type": "pricing",
        "fields": {
            "price_unit": "priceUnit",
            "price_interval": "priceInterval"
        },
        "optional_fields": [
            "price_unit",
            "price_interval"
        ]
    }
    cq = ContentQuestion(manifest)
    result = pricing_property(cq)
    assert "" in result['priceUnit']['enum']
    assert "" in result['priceInterval']['enum']