@@ -173,10 +173,10 @@ def _get_canvas_properties(
173173 @patch ("common.djangoapps.student.tasks.get_owners_for_course" )
174174 @patch ("common.djangoapps.student.tasks.get_course_run_details" )
175175 @patch ("common.djangoapps.student.tasks.get_course_dates_for_email" )
176- @patch ("common.djangoapps.student.tasks.get_email_client " )
176+ @patch ("common.djangoapps.student.tasks.get_braze_client " )
177177 def test_success_calls_for_canvas_properties (
178178 self ,
179- mock_get_email_client ,
179+ mock_get_braze_client ,
180180 mock_get_course_dates_for_email ,
181181 mock_get_course_run_details ,
182182 mock_get_owners_for_course ,
@@ -194,7 +194,7 @@ def test_success_calls_for_canvas_properties(
194194 send_course_enrollment_email .apply_async (
195195 kwargs = self .send_course_enrollment_email_kwargs
196196 )
197- mock_get_email_client .return_value .send_canvas_message .assert_called_with (
197+ mock_get_braze_client .return_value .send_canvas_message .assert_called_with (
198198 canvas_id = BRAZE_COURSE_ENROLLMENT_CANVAS_ID ,
199199 recipients = [
200200 {
@@ -207,14 +207,14 @@ def test_success_calls_for_canvas_properties(
207207 @patch ("common.djangoapps.student.tasks.get_course_uuid_for_course" )
208208 @patch ("common.djangoapps.student.tasks.get_owners_for_course" )
209209 @patch ("common.djangoapps.student.tasks.get_course_run_details" )
210- @patch ("common.djangoapps.student.tasks.get_email_client " )
210+ @patch ("common.djangoapps.student.tasks.get_braze_client " )
211211 @patch (
212212 "common.djangoapps.student.tasks.get_course_dates_for_email" ,
213213 Mock (side_effect = Exception ),
214214 )
215215 def test_canvas_properties_without_course_dates (
216216 self ,
217- mock_get_email_client ,
217+ mock_get_braze_client ,
218218 mock_get_course_run_details ,
219219 mock_get_owners_for_course ,
220220 mock_get_course_uuid_for_course ,
@@ -230,7 +230,7 @@ def test_canvas_properties_without_course_dates(
230230 send_course_enrollment_email .apply_async (
231231 kwargs = self .send_course_enrollment_email_kwargs
232232 )
233- mock_get_email_client .return_value .send_canvas_message .assert_called_with (
233+ mock_get_braze_client .return_value .send_canvas_message .assert_called_with (
234234 canvas_id = BRAZE_COURSE_ENROLLMENT_CANVAS_ID ,
235235 recipients = [
236236 {
@@ -243,14 +243,14 @@ def test_canvas_properties_without_course_dates(
243243 @patch ("common.djangoapps.student.tasks.get_course_uuid_for_course" )
244244 @patch ("common.djangoapps.student.tasks.get_owners_for_course" )
245245 @patch ("common.djangoapps.student.tasks.get_course_dates_for_email" )
246- @patch ("common.djangoapps.student.tasks.get_email_client " )
246+ @patch ("common.djangoapps.student.tasks.get_braze_client " )
247247 @patch (
248248 "common.djangoapps.student.tasks.get_course_run_details" ,
249249 Mock (side_effect = Exception ),
250250 )
251251 def test_canvas_properties_on_get_course_run_details_failure (
252252 self ,
253- mock_get_email_client ,
253+ mock_get_braze_client ,
254254 mock_get_course_dates_for_email ,
255255 mock_get_owners_for_course ,
256256 mock_get_course_uuid_for_course ,
@@ -266,7 +266,7 @@ def test_canvas_properties_on_get_course_run_details_failure(
266266 send_course_enrollment_email .apply_async (
267267 kwargs = self .send_course_enrollment_email_kwargs
268268 )
269- mock_get_email_client .return_value .send_canvas_message .assert_called_with (
269+ mock_get_braze_client .return_value .send_canvas_message .assert_called_with (
270270 canvas_id = BRAZE_COURSE_ENROLLMENT_CANVAS_ID ,
271271 recipients = [
272272 {
@@ -280,12 +280,12 @@ def test_canvas_properties_on_get_course_run_details_failure(
280280
281281 @patch ("common.djangoapps.student.tasks.get_course_uuid_for_course" )
282282 @patch ("common.djangoapps.student.tasks.get_course_dates_for_email" )
283- @patch ("common.djangoapps.student.tasks.get_email_client " )
283+ @patch ("common.djangoapps.student.tasks.get_braze_client " )
284284 @patch (TASK_LOGGER )
285285 def test_email_task_when_course_uuid_is_missing (
286286 self ,
287287 mocked_logger ,
288- mock_get_email_client ,
288+ mock_get_braze_client ,
289289 mock_get_course_dates_for_email ,
290290 mock_get_course_uuid_for_course ,
291291 ):
@@ -304,7 +304,7 @@ def test_email_task_when_course_uuid_is_missing(
304304 f"[Course Enrollment] Course run call failed for "
305305 f"user: { self .user .id } course: { self .course .id } error: Missing course_uuid"
306306 )
307- mock_get_email_client .return_value .send_canvas_message .assert_called_with (
307+ mock_get_braze_client .return_value .send_canvas_message .assert_called_with (
308308 canvas_id = BRAZE_COURSE_ENROLLMENT_CANVAS_ID ,
309309 recipients = [
310310 {
@@ -318,12 +318,12 @@ def test_email_task_when_course_uuid_is_missing(
318318 @patch ("common.djangoapps.student.tasks.get_owners_for_course" )
319319 @patch ("common.djangoapps.student.tasks.get_course_run_details" )
320320 @patch ("common.djangoapps.student.tasks.get_course_dates_for_email" )
321- @patch ("common.djangoapps.student.tasks.get_email_client " )
321+ @patch ("common.djangoapps.student.tasks.get_braze_client " )
322322 @patch (TASK_LOGGER )
323323 def test_email_task_when_course_run_is_missing (
324324 self ,
325325 mocked_logger ,
326- mock_get_email_client ,
326+ mock_get_braze_client ,
327327 mock_get_course_dates_for_email ,
328328 mock_get_course_run_details ,
329329 mock_get_owners_for_course ,
@@ -346,7 +346,7 @@ def test_email_task_when_course_run_is_missing(
346346 f"[Course Enrollment] Course run call failed for "
347347 f"user: { self .user .id } course: { self .course .id } error: Missing course_run"
348348 )
349- mock_get_email_client .return_value .send_canvas_message .assert_called_with (
349+ mock_get_braze_client .return_value .send_canvas_message .assert_called_with (
350350 canvas_id = BRAZE_COURSE_ENROLLMENT_CANVAS_ID ,
351351 recipients = [
352352 {
@@ -360,7 +360,7 @@ def test_email_task_when_course_run_is_missing(
360360 @patch ("common.djangoapps.student.tasks.get_owners_for_course" )
361361 @patch ("common.djangoapps.student.tasks.get_course_run_details" )
362362 @patch ("common.djangoapps.student.tasks.get_course_dates_for_email" )
363- def test_retry_with_email_client_exception (
363+ def test_retry_with_braze_client_exception (
364364 self ,
365365 mock_get_course_dates_for_email ,
366366 mock_get_course_run_details ,
@@ -377,12 +377,12 @@ def test_retry_with_email_client_exception(
377377 mock_get_course_dates_for_email .return_value = self ._get_course_dates ()
378378
379379 with patch (
380- 'common.djangoapps.student.tasks.get_email_client ' ,
380+ 'common.djangoapps.student.tasks.get_braze_client ' ,
381381 new_callable = PropertyMock ,
382382 side_effect = Exception ('Braze Client Exception' )
383- ) as mock_get_email_client :
383+ ) as mock_get_braze_client :
384384 task = send_course_enrollment_email .apply_async (
385385 kwargs = self .send_course_enrollment_email_kwargs
386386 )
387387 pytest .raises (Exception , task .get )
388- self .assertEqual (mock_get_email_client .call_count , (MAX_RETRIES + 1 ))
388+ self .assertEqual (mock_get_braze_client .call_count , (MAX_RETRIES + 1 ))
0 commit comments