Skip to content

Commit

Permalink
Adjust tetsts
Browse files Browse the repository at this point in the history
  • Loading branch information
Tschuppi81 committed Jan 6, 2025
1 parent 85456b3 commit 746eb1d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ repos:
exclude: .pre-commit-config.yaml
- id: pt_structure
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
rev: v0.8.6
hooks:
- id: ruff
args: [ "--fix" ]
Expand Down
4 changes: 2 additions & 2 deletions tests/onegov/form/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ def test_integer_range_with_pricing():
]))
form.validate()
assert not form.errors
assert form.stamps.pricing.price(form.stamps) == Price(8.5, 'CHF')
assert form.stamps.pricing.price(form.stamps) == Price(10.00, 'CHF')

form_class = parse_form("Stamps *= 0..20 (1.00 CHF!)")
form = form_class(MultiDict([
Expand All @@ -890,7 +890,7 @@ def test_integer_range_with_pricing():
}
assert form.stamps.pricing.has_payment_rule
assert form.stamps.pricing.price(form.stamps) == Price(
17, 'CHF', credit_card_payment=True
20.00, 'CHF', credit_card_payment=True
)


Expand Down
8 changes: 4 additions & 4 deletions tests/onegov/org/test_views_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,11 @@ def test_add_custom_form_minimum_price_validation(client):
form_page.form['definition'] = textwrap.dedent("""
E-Mail *= @@@
Stamp A = 0..20 (1.10 CHF)
Stamp A = 0..20 (1.20 CHF)
Stamp B = 0..20 (1.00 CHF)
Discount *=
(x) First four B stamps free (-3.40 CHF)
(x) First four B stamps free (-4.00 CHF)
""")
form_page.form['minimum_price_total'] = '5.00'
form_page = form_page.form.submit().follow()
Expand All @@ -281,14 +281,14 @@ def test_add_custom_form_minimum_price_validation(client):
form_page = form_page.form.submit().follow()

assert "Der Totalbetrag für Ihre Eingaben" in form_page
assert "beläuft sich auf 1.70 CHF" in form_page
assert "beläuft sich auf 2.00 CHF" in form_page
assert "allerdings ist der Minimalbetrag 5.00 CHF" in form_page

# now that we reached the minimum price we should succeed
form_page.form['stamp_a'] = '3'
form_page = form_page.form.submit()
assert "Totalbetrag" in form_page
assert "5.00 CHF" in form_page
assert "5.60 CHF" in form_page
assert "Minimalbetrag" not in form_page


Expand Down

0 comments on commit 746eb1d

Please sign in to comment.