diff --git a/common/djangoapps/third_party_auth/tests/specs/base.py b/common/djangoapps/third_party_auth/tests/specs/base.py index 3c34754931..1ffd450f1a 100644 --- a/common/djangoapps/third_party_auth/tests/specs/base.py +++ b/common/djangoapps/third_party_auth/tests/specs/base.py @@ -424,6 +424,7 @@ class IntegrationTest(testutil.TestCase, test.TestCase): request, strategy = self.get_request_and_strategy( auth_entry=pipeline.AUTH_ENTRY_LOGIN, redirect_uri='social:complete') strategy.backend.auth_complete = mock.MagicMock(return_value=self.fake_auth_complete(strategy)) + pipeline.analytics.track = mock.MagicMock() request.user = self.create_user_models_for_existing_account( strategy, 'user@example.com', 'password', self.get_username(), skip_social_auth=True) @@ -558,6 +559,7 @@ class IntegrationTest(testutil.TestCase, test.TestCase): request, strategy = self.get_request_and_strategy( auth_entry=pipeline.AUTH_ENTRY_LOGIN, redirect_uri='social:complete') strategy.backend.auth_complete = mock.MagicMock(return_value=self.fake_auth_complete(strategy)) + pipeline.analytics.track = mock.MagicMock() user = self.create_user_models_for_existing_account( strategy, 'user@example.com', 'password', self.get_username()) self.assert_social_auth_exists_for_user(user, strategy) diff --git a/lms/djangoapps/shoppingcart/tests/test_models.py b/lms/djangoapps/shoppingcart/tests/test_models.py index 83d412c4fc..4718d25e81 100644 --- a/lms/djangoapps/shoppingcart/tests/test_models.py +++ b/lms/djangoapps/shoppingcart/tests/test_models.py @@ -3,6 +3,7 @@ Tests for the Shopping Cart Models """ from decimal import Decimal import datetime +import sys import smtplib from boto.exception import BotoServerError # this is a super-class of SESError and catches connection errors @@ -233,7 +234,9 @@ class OrderTest(ModuleStoreTestCase): item = CertificateItem.add_to_order(cart, self.course_key, self.cost, 'honor') # course enrollment object should be created but still inactive self.assertFalse(CourseEnrollment.is_enrolled(self.user, self.course_key)) - cart.purchase() + # the analytics client pipes output to stderr when using the default client + with patch('sys.stderr', sys.stdout.write): + cart.purchase() self.assertTrue(CourseEnrollment.is_enrolled(self.user, self.course_key)) # test e-mail sending