Skip to content

Commit

Permalink
chore: Removing commented useless code. (#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
grmartin authored Jul 1, 2024
1 parent 7da363e commit 19333ec
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 42 deletions.
22 changes: 0 additions & 22 deletions commerce_coordinator/apps/commercetools/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,28 +129,6 @@ def test_view_returns_ok(self, _mock_signal):
# Check 200 OK
self.assertEqual(response.status_code, 200)

# # TODO: GRM: Move to Signals tests
# def test_view_sends_expected_signal_parameters(self, mock_customer, mock_order, mock_signal):
# """Check view sends expected signal parameters."""
# # Login
# self.client.login(username=self.test_staff_username, password=self.test_password)
#
# # Send request
# self.client.post(self.url, data=EXAMPLE_COMMERCETOOLS_ORDER_FULFILL_MESSAGE, format='json')
#
# # Check expected response
# mock_signal.assert_called_once_with(**EXAMPLE_FULFILLMENT_SIGNAL_PAYLOAD)

# # TODO: GRM: Move to Signals tests
# @patch("commerce_coordinator.apps.commercetools.views.send_order_confirmation_email")
# def test_view_triggers_order_confirmation_email(self, mock_send_email, mock_customer, mock_order, mock_signal):
# """Check view sends expected signal parameters."""
# self.client.login(username=self.test_staff_username, password=self.test_password)
#
# self.client.post(self.url, data=EXAMPLE_COMMERCETOOLS_ORDER_FULFILL_MESSAGE, format='json')
#
# mock_send_email.assert_called_once()

def test_view_returns_expected_error(self, _mock_signal):
"""Check an authorized account requesting fulfillment with bad inputs receive an expected error."""

Expand Down
20 changes: 0 additions & 20 deletions commerce_coordinator/apps/lms/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,26 +70,6 @@ def test_view_rejects_unauthorized(self):
# Error HTTP_302_FOUND
self.assertEqual(response.status_code, status.HTTP_302_FOUND)

# TODO: FIX Per SONIC-354
# @patch('commerce_coordinator.apps.rollout.pipeline.logger')
# @patch('commerce_coordinator.apps.commercetools.clients.CommercetoolsAPIClient')
# def test_get_product_variant_by_course_run_failure(self, mock_ct_client, mock_logger):
# self.client.login(username=self.test_user_username, password=self.test_user_password)
# self.client.force_authenticate(user=self.user)
#
# mock_ct_client.return_value.get_product_variant_by_course_run.side_effect = HTTPError('Error in CT search')
# self.client.get(
# self.url,
# {'sku': ['sku1'], 'course_run_key': 'course-v1:MichiganX+InjuryPreventionX+1T2021'}
# )
#
# mock_logger.exception.assert_called_once_with(
# '[get_product_variant_by_course_run] Failed to get CT course for course_run: '
# 'course-v1:MichiganX+InjuryPreventionX+1T2021 with exception: Error in CT search'
# )
#
# mock_ct_client.reset_mock(return_value=True, side_effect=True)

@patch('commerce_coordinator.apps.rollout.pipeline.is_user_enterprise_learner')
@patch('commerce_coordinator.apps.rollout.pipeline.is_redirect_to_commercetools_enabled_for_user')
def test_run_rollout_pipeline_redirect_to_commercetools(self, is_redirect_mock, is_enterprise_mock):
Expand Down

0 comments on commit 19333ec

Please sign in to comment.