Skip to content

Commit 1c4aa22

Browse files
committed
fix tests
1 parent a45242c commit 1c4aa22

File tree

1 file changed

+8
-22
lines changed

1 file changed

+8
-22
lines changed

webapp/ordering/tests/test_core.py

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -268,35 +268,21 @@ def test_latest_order_round_is_returned(self):
268268

269269

270270
class TestAutomaticOrderRoundCreation(VokoTestCase):
271-
@freeze_time("2025-09-18")
271+
@freeze_time("2025-08-25")
272272
def test_create_orderround_batch_no_order_rounds_yet(self):
273273
"""Test creating order rounds when no order rounds exist yet"""
274-
# When there are no order rounds, should create from next week to end of current quarter
274+
# When there are no order rounds, should create from next week to end of next quarter
275275
result = create_orderround_batch()
276276

277-
self.assertEqual(len(result), 1) # Only one order round should fit in this period
278-
279-
def test_create_orderround_batch_one_order_round_no_more_in_quarter(self):
280-
"""Test when there's one order round but no more planned for rest of current quarter"""
281-
# Create an existing order round early in the quarter
282-
_ = OrderRoundFactory(
283-
open_for_orders=datetime(2024, 1, 8, 8, 0, tzinfo=UTC), # Early January
284-
closed_for_orders=datetime(2024, 1, 12, 8, 0, tzinfo=UTC),
285-
collect_datetime=datetime(2024, 1, 17, 18, 0, tzinfo=UTC),
286-
)
277+
self.assertEqual(len(result), 2) # Two order rounds should be created
287278

279+
@freeze_time("2025-09-18")
280+
def test_create_orderround_batch_no_order_rounds_yet_next_quarter_close(self):
281+
"""Test creating order rounds when no order rounds exist yet but next quarter is close"""
282+
# When there are no order rounds and next quarter is close, should create from next week to end of next quarter
288283
result = create_orderround_batch()
289284

290-
# Should create order rounds from January 22 (2 weeks after Jan 8) to end of Q1
291-
# This should create multiple order rounds to fill the gap
292-
self.assertGreater(len(result), 0)
293-
294-
# Get last ourder round
295-
last_round = get_last_order_round()
296-
297-
# Last order round should be before next quarter
298-
last_day_current_quarter, _ = get_quarter_end_dates()
299-
self.assertGreater(last_day_current_quarter, last_round.closed_for_orders.date())
285+
self.assertEqual(len(result), 7) # Seven order rounds should be created
300286

301287
@freeze_time("2024-02-01")
302288
def test_create_orderround_batch_next_quarter_far_away(self):

0 commit comments

Comments
 (0)