コード例 #1
0
def test_max_price_larger_than_min_price_with_multiple_price_fields():
    data = {
        'agileCoachPriceMin': '200',
        'agileCoachPriceMax': '250',
        'developerPriceMin': '200',
        'developerPriceMax': '25',
        'windowCleanerPriceMin': '12.50',
        'windowCleanerPriceMax': '300',
    }
    errors = min_price_less_than_max_price({}, data)
    assert_equal(errors, {'developerPriceMax': 'max_less_than_min'})
コード例 #2
0
def test_max_price_larger_than_min_price_with_multiple_price_fields():
    data = {
        'agileCoachPriceMin': '200',
        'agileCoachPriceMax': '250',
        'developerPriceMin': '200',
        'developerPriceMax': '25',
        'windowCleanerPriceMin': '12.50',
        'windowCleanerPriceMax': '300',
    }
    errors = min_price_less_than_max_price({}, data)
    assert_equal(errors, {'developerPriceMax': 'max_less_than_min'})
コード例 #3
0
def test_max_price_larger_than_min_price_with_multiple_price_errors():
    data = {
        'agileCoachPriceMin': '200',
        'agileCoachPriceMax': '250',
        'developerPriceMin': '200',
        'developerPriceMax': '25',
        'designerPriceMin': '300',
        'designerPriceMax': '299.99',
        'windowCleanerPriceMin': '12.50',
        'windowCleanerPriceMax': '300',
    }
    errors = min_price_less_than_max_price({}, data)
    assert errors == {'developerPriceMax': 'max_less_than_min', 'designerPriceMax': 'max_less_than_min'}
コード例 #4
0
def test_max_price_larger_than_min_price_with_multiple_price_errors():
    data = {
        'agileCoachPriceMin': '200',
        'agileCoachPriceMax': '250',
        'developerPriceMin': '200',
        'developerPriceMax': '25',
        'designerPriceMin': '300',
        'designerPriceMax': '299.99',
        'windowCleanerPriceMin': '12.50',
        'windowCleanerPriceMax': '300',
    }
    errors = min_price_less_than_max_price({}, data)
    assert errors == {'developerPriceMax': 'max_less_than_min', 'designerPriceMax': 'max_less_than_min'}
コード例 #5
0
def test_max_price_larger_than_min_does_not_overwrite_previous_errors():
    data = {
        'agileCoachPriceMin': '200',
        'agileCoachPriceMax': '250',
        'developerPriceMin': '200',
        'developerPriceMax': '25',
        'designerPriceMin': '300',
        'designerPriceMax': '299.99',
        'windowCleanerPriceMin': '12.50',
        'windowCleanerPriceMax': '300',
    }
    previous_errors = {'designerPriceMax': 'non_curly_quotes'}
    errors = min_price_less_than_max_price(previous_errors, data)
    assert_equal(errors, {'developerPriceMax': 'max_less_than_min'})
コード例 #6
0
def test_max_price_larger_than_min_does_not_overwrite_previous_errors():
    data = {
        'agileCoachPriceMin': '200',
        'agileCoachPriceMax': '250',
        'developerPriceMin': '200',
        'developerPriceMax': '25',
        'designerPriceMin': '300',
        'designerPriceMax': '299.99',
        'windowCleanerPriceMin': '12.50',
        'windowCleanerPriceMax': '300',
    }
    previous_errors = {'designerPriceMax': 'non_curly_quotes'}
    errors = min_price_less_than_max_price(previous_errors, data)
    assert_equal(errors, {'developerPriceMax': 'max_less_than_min'})