Reword the comments in the test suite

Each comment is one sentence or two short ones
joined by "=>", without a final period.
This commit is contained in:
Alexander Hess 2026-12-03 10:52:09 +01:00
commit bca4250b4d
Signed by: alexander
GPG key ID: B46EDB4DFC26805D

View file

@ -100,11 +100,8 @@ class TestConstraints:
with pytest.raises(sa_exc.IntegrityError, match="fk_orders_to_restaurants"):
db_session.commit()
# Here should be a test to check deletion of a referenced pickup address,
# so `test_delete_a_referenced_pickup_address(self, db_session, order)`.
# The corresponding "fk_orders_to_addresses_on_pickup_address_id" constraint
# is very hard to test in isolation as the above "fk_orders_to_restaurants_..."
# constraint ensures its integrity already.
# No test for "fk_orders_to_addresses_on_pickup_address_id" as the
# "fk_orders_to_restaurants_..." constraint already ensures its integrity
def test_delete_a_referenced_delivery_address(self, db_session, order):
"""Remove a record that is referenced with a FK."""
@ -289,13 +286,11 @@ class TestConstraints:
Scheduled orders must be at least 30 minutes into the future.
"""
# Create an ad-hoc order first and then make that a scheduled order.
# This way, it is less work to keep the timestamps consistent.
# Turning an ad-hoc order into a scheduled one keeps the timestamps consistent
pre_order = make_order(scheduled=False)
# Make the `scheduled_delivery_at` the quarter of an hour
# following the next quarter of an hour (i.e., the timestamp
# is between 15 and 30 minutes into the future)
# Schedule the delivery at the quarter of an hour after the next one
# => It is 15 to 30 minutes into the future
pre_order.ad_hoc = False
minutes_to_next_quarter = 15 - (pre_order.placed_at.minute % 15)
pre_order.scheduled_delivery_at = (
@ -1187,8 +1182,8 @@ def test_make_random_orders(
else:
cancel_before_pickup, cancel_after_pickup = False, False
# Write all the generated objects to the database.
# This should already trigger an `IntegrityError` if the data are flawed.
# Writing all generated objects to the database checks their integrity
# => An `IntegrityError` here means the fake data are flawed
order = make_order(
scheduled=scheduled,
restaurant=restaurant,