Skip to content

Commit 47b3b63

Browse files
authored
Merge pull request #127 from PyAr/fix-wizard-test
Fix: ajuste de test al nuevo formato de schedule de wizards.
2 parents 2181462 + 9f87ab0 commit 47b3b63

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

test/test_pycamp_model.py

+11-13
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def init_pycamp(self):
3434
)
3535

3636
@use_test_database
37-
@freeze_time("2024-06-21 11:30:00")
37+
@freeze_time("2024-06-21 15:30:00")
3838
def test_returns_correct_wizard_within_its_turno(self):
3939
"""Integration test using persist_wizards_schedule_in_db."""
4040
p = Pycamp.create(
@@ -59,18 +59,16 @@ def test_no_scheduled_wizard_then_return_none(self):
5959
assert p.get_current_wizard() is None
6060

6161
@use_test_database
62-
@freeze_time("2024-06-20 10:30:00")
62+
@freeze_time("2024-06-21 15:30:00")
6363
def test_many_scheduled_wizard_then_return_one_of_them(self):
6464
p = Pycamp.create(
65-
headquarters="Narnia"
66-
)
67-
# Wizard exists, scheduled in the same time slot.
68-
gandalf = Pycampista.create(username="gandalf", wizard=True)
69-
merlin = Pycampista.create(username="merlin", wizard=True)
70-
ini = datetime(2024,6,20,10,0,0)
71-
end = datetime(2024,6,20,11,0,0)
72-
WizardAtPycamp.create(pycamp=p, wizard=gandalf, init=ini, end=end)
73-
WizardAtPycamp.create(pycamp=p, wizard=merlin, init=ini, end=end)
74-
65+
headquarters="Narnia",
66+
init=datetime(2024,6,20),
67+
end=datetime(2024,6,23),
68+
)
69+
w1 = p.add_wizard("gandalf", 123)
70+
w2 = p.add_wizard("merlin", 456 )
71+
wizard.persist_wizards_schedule_in_db(p)
7572
w = p.get_current_wizard()
76-
assert w == gandalf or w == merlin
73+
74+
assert w == w1 or w == w2

0 commit comments

Comments
 (0)