@@ -28,7 +28,7 @@ def test_start_gets_scheduler_lock(self):
2828 @pytest .mark .django_db
2929 def test_handle_submission_event_not_supported_raises_exception (self , jobstore ):
3030 event = JobSubmissionEvent (
31- events .EVENT_ALL , "test_job" , jobstore , [timezone .now ()]
31+ events .EVENT_ALL , "test_job" , jobstore . _alias , [timezone .now ()]
3232 )
3333
3434 with pytest .raises (NotImplementedError ):
@@ -46,7 +46,7 @@ def test_handle_submission_event_creates_job_execution(
4646 self , event_code , jobstore , create_add_job
4747 ):
4848 job = create_add_job (jobstore , dummy_job , datetime (2016 , 5 , 3 ))
49- event = JobSubmissionEvent (event_code , job .id , jobstore , [timezone .now ()])
49+ event = JobSubmissionEvent (event_code , job .id , jobstore . _alias , [timezone .now ()])
5050 jobstore .handle_submission_event (event )
5151
5252 assert DjangoJobExecution .objects .filter (job_id = event .job_id ).exists ()
@@ -56,7 +56,7 @@ def test_handle_submission_event_for_job_that_no_longer_exists_does_not_raise_ex
5656 self , jobstore
5757 ):
5858 event = JobSubmissionEvent (
59- events .EVENT_JOB_SUBMITTED , "finished_job" , jobstore , [timezone .now ()]
59+ events .EVENT_JOB_SUBMITTED , "finished_job" , jobstore . _alias , [timezone .now ()]
6060 )
6161 jobstore .handle_submission_event (event )
6262
@@ -65,7 +65,7 @@ def test_handle_submission_event_for_job_that_no_longer_exists_does_not_raise_ex
6565 @pytest .mark .django_db
6666 def test_handle_execution_event_not_supported_raises_exception (self , jobstore ):
6767 event = JobExecutionEvent (
68- events .EVENT_ALL , "test_job" , jobstore , timezone .now ()
68+ events .EVENT_ALL , "test_job" , jobstore . _alias , timezone .now ()
6969 )
7070
7171 with pytest .raises (NotImplementedError ):
@@ -77,7 +77,7 @@ def test_handle_execution_event_creates_job_execution(
7777 ):
7878 job = create_add_job (jobstore , dummy_job , datetime (2016 , 5 , 3 ))
7979 event = JobExecutionEvent (
80- events .EVENT_JOB_EXECUTED , job .id , jobstore , timezone .now ()
80+ events .EVENT_JOB_EXECUTED , job .id , jobstore . _alias , timezone .now ()
8181 )
8282 jobstore .handle_execution_event (event )
8383
@@ -89,7 +89,7 @@ def test_handle_execution_event_for_job_that_no_longer_exists_does_not_raise_exc
8989 ):
9090 # Test for regression https://github.com/jcass77/django-apscheduler/issues/116
9191 event = JobExecutionEvent (
92- events .EVENT_JOB_EXECUTED , "finished_job" , jobstore , timezone .now ()
92+ events .EVENT_JOB_EXECUTED , "finished_job" , jobstore . _alias , timezone .now ()
9393 )
9494 jobstore .handle_execution_event (event )
9595
@@ -98,7 +98,7 @@ def test_handle_execution_event_for_job_that_no_longer_exists_does_not_raise_exc
9898 @pytest .mark .django_db
9999 def test_handle_error_event_not_supported_raises_exception (self , jobstore ):
100100 event = JobExecutionEvent (
101- events .EVENT_ALL , "test_job" , jobstore , timezone .now ()
101+ events .EVENT_ALL , "test_job" , jobstore . _alias , timezone .now ()
102102 )
103103
104104 with pytest .raises (NotImplementedError ):
@@ -116,7 +116,7 @@ def test_handle_error_event_creates_job_execution(
116116 self , jobstore , create_add_job , event_code
117117 ):
118118 job = create_add_job (jobstore , dummy_job , datetime (2016 , 5 , 3 ))
119- event = JobExecutionEvent (event_code , job .id , jobstore , timezone .now ())
119+ event = JobExecutionEvent (event_code , job .id , jobstore . _alias , timezone .now ())
120120 jobstore .handle_error_event (event )
121121
122122 assert DjangoJobExecution .objects .filter (job_id = event .job_id ).exists ()
@@ -127,7 +127,7 @@ def test_handle_error_event_no_exception_sets_exception_text(
127127 ):
128128 job = create_add_job (jobstore , dummy_job , datetime (2016 , 5 , 3 ))
129129 event = JobExecutionEvent (
130- events .EVENT_JOB_ERROR , job .id , jobstore , timezone .now ()
130+ events .EVENT_JOB_ERROR , job .id , jobstore . _alias , timezone .now ()
131131 )
132132 jobstore .handle_error_event (event )
133133
@@ -140,7 +140,7 @@ def test_handle_error_event_for_job_that_no_longer_exists_does_not_raise_excepti
140140 self , jobstore
141141 ):
142142 event = JobExecutionEvent (
143- events .EVENT_JOB_ERROR , "finished_job" , jobstore , timezone .now ()
143+ events .EVENT_JOB_ERROR , "finished_job" , jobstore . _alias , timezone .now ()
144144 )
145145 jobstore .handle_error_event (event )
146146
0 commit comments