misc: remove django2 compat in tests (#89605)
This commit is contained in:
parent
4615f17360
commit
736136afd0
|
@ -1256,31 +1256,17 @@ def test_detail_pricing_test_tool_for_event(mock_pricing_data_event, mock_event,
|
|||
)
|
||||
]
|
||||
|
||||
# XXX Compat: html entities are slightly different under django 2 and django 3
|
||||
# the following code ensure tests pass under both versions.
|
||||
# The output looks exactly the same to an end user.
|
||||
assert '<p>Pricing: 42.00</p>' in resp
|
||||
django2_match = (
|
||||
'<pre>{'foo': 'bar', 'pricing': Decimal('42')}</pre>' in resp
|
||||
)
|
||||
django3_match = (
|
||||
assert (
|
||||
'<pre>{'foo': 'bar', 'pricing': Decimal('42')}</pre>' in resp
|
||||
)
|
||||
assert django2_match or django3_match
|
||||
|
||||
mock_pricing_data_event.side_effect = PricingError(details={'foo': 'error'})
|
||||
resp = resp.form.submit().follow()
|
||||
assert 'Computed pricing data' in resp
|
||||
|
||||
django2_match = ''error': <class 'lingo.pricing.models.PricingError'>' in resp
|
||||
django3_match = ''error': <class 'lingo.pricing.models.PricingError'>' in resp
|
||||
|
||||
assert django2_match or django3_match
|
||||
|
||||
django2_match = ''error_details': {'foo': 'error'}' in resp
|
||||
django3_match = ''error_details': {'foo': 'error'}' in resp
|
||||
|
||||
assert django2_match or django3_match
|
||||
assert ''error': <class 'lingo.pricing.models.PricingError'>' in resp
|
||||
assert ''error_details': {'foo': 'error'}' in resp
|
||||
|
||||
# check recurring event
|
||||
mock_pricing_data_event.reset_mock()
|
||||
|
@ -1432,28 +1418,16 @@ def test_detail_pricing_test_tool_for_flat_fee_schedule(mock_pricing_data, app,
|
|||
)
|
||||
]
|
||||
assert '<p>Pricing: 42.00</p>' in resp
|
||||
django2_match = (
|
||||
'<pre>{'foo': 'bar', 'pricing': Decimal('42')}</pre>' in resp
|
||||
)
|
||||
django3_match = (
|
||||
assert (
|
||||
'<pre>{'foo': 'bar', 'pricing': Decimal('42')}</pre>' in resp
|
||||
)
|
||||
|
||||
assert django2_match or django3_match
|
||||
|
||||
mock_pricing_data.side_effect = PricingError(details={'foo': 'error'})
|
||||
resp = resp.form.submit().follow()
|
||||
assert 'Computed pricing data' in resp
|
||||
|
||||
django2_match = ''error': <class 'lingo.pricing.models.PricingError'>' in resp
|
||||
django3_match = ''error': <class 'lingo.pricing.models.PricingError'>' in resp
|
||||
|
||||
assert django2_match or django3_match
|
||||
|
||||
django2_match = ''error_details': {'foo': 'error'}' in resp
|
||||
django3_match = ''error_details': {'foo': 'error'}' in resp
|
||||
|
||||
assert django2_match or django3_match
|
||||
assert ''error': <class 'lingo.pricing.models.PricingError'>' in resp
|
||||
assert ''error_details': {'foo': 'error'}' in resp
|
||||
|
||||
billing_date1 = pricing.billingdates.create(
|
||||
date_start=datetime.date(2021, 9, 1),
|
||||
|
|
Loading…
Reference in New Issue