@@ -34,7 +34,7 @@ def init_pycamp(self):
34
34
)
35
35
36
36
@use_test_database
37
- @freeze_time ("2024-06-21 11 :30:00" )
37
+ @freeze_time ("2024-06-21 15 :30:00" )
38
38
def test_returns_correct_wizard_within_its_turno (self ):
39
39
"""Integration test using persist_wizards_schedule_in_db."""
40
40
p = Pycamp .create (
@@ -59,18 +59,16 @@ def test_no_scheduled_wizard_then_return_none(self):
59
59
assert p .get_current_wizard () is None
60
60
61
61
@use_test_database
62
- @freeze_time ("2024-06-20 10 :30:00" )
62
+ @freeze_time ("2024-06-21 15 :30:00" )
63
63
def test_many_scheduled_wizard_then_return_one_of_them (self ):
64
64
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 )
75
72
w = p .get_current_wizard ()
76
- assert w == gandalf or w == merlin
73
+
74
+ assert w == w1 or w == w2
0 commit comments