From 9f87ab07eff64c0e214488613334d655df049478 Mon Sep 17 00:00:00 2001 From: jeremyakd Date: Sun, 23 Mar 2025 12:46:20 -0300 Subject: [PATCH] Fix: ajuste de test al nuevo formato de schedule de wizards. --- test/test_pycamp_model.py | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/test/test_pycamp_model.py b/test/test_pycamp_model.py index 56248de..73199b9 100644 --- a/test/test_pycamp_model.py +++ b/test/test_pycamp_model.py @@ -34,7 +34,7 @@ def init_pycamp(self): ) @use_test_database - @freeze_time("2024-06-21 11:30:00") + @freeze_time("2024-06-21 15:30:00") def test_returns_correct_wizard_within_its_turno(self): """Integration test using persist_wizards_schedule_in_db.""" p = Pycamp.create( @@ -59,18 +59,16 @@ def test_no_scheduled_wizard_then_return_none(self): assert p.get_current_wizard() is None @use_test_database - @freeze_time("2024-06-20 10:30:00") + @freeze_time("2024-06-21 15:30:00") def test_many_scheduled_wizard_then_return_one_of_them(self): p = Pycamp.create( - headquarters="Narnia" - ) - # Wizard exists, scheduled in the same time slot. - gandalf = Pycampista.create(username="gandalf", wizard=True) - merlin = Pycampista.create(username="merlin", wizard=True) - ini = datetime(2024,6,20,10,0,0) - end = datetime(2024,6,20,11,0,0) - WizardAtPycamp.create(pycamp=p, wizard=gandalf, init=ini, end=end) - WizardAtPycamp.create(pycamp=p, wizard=merlin, init=ini, end=end) - + headquarters="Narnia", + init=datetime(2024,6,20), + end=datetime(2024,6,23), + ) + w1 = p.add_wizard("gandalf", 123) + w2 = p.add_wizard("merlin", 456 ) + wizard.persist_wizards_schedule_in_db(p) w = p.get_current_wizard() - assert w == gandalf or w == merlin \ No newline at end of file + + assert w == w1 or w == w2