diff --git a/lms/djangoapps/shoppingcart/tests/test_models.py b/lms/djangoapps/shoppingcart/tests/test_models.py index 89f0e3a708..4718d25e81 100644 --- a/lms/djangoapps/shoppingcart/tests/test_models.py +++ b/lms/djangoapps/shoppingcart/tests/test_models.py @@ -3,7 +3,7 @@ Tests for the Shopping Cart Models """ from decimal import Decimal import datetime -import os +import sys import smtplib from boto.exception import BotoServerError # this is a super-class of SESError and catches connection errors @@ -235,8 +235,7 @@ class OrderTest(ModuleStoreTestCase): # course enrollment object should be created but still inactive self.assertFalse(CourseEnrollment.is_enrolled(self.user, self.course_key)) # the analytics client pipes output to stderr when using the default client - devnull = open(os.devnull, 'w') - with patch('sys.stderr', devnull): + with patch('sys.stderr', sys.stdout.write): cart.purchase() self.assertTrue(CourseEnrollment.is_enrolled(self.user, self.course_key))