Fix another analytics.init secret error message (noise).

This commit is contained in:
Ben Patterson
2014-12-13 19:28:15 -05:00
parent 7be7b50ba9
commit 352fce6e02

View File

@@ -3,6 +3,7 @@ Tests for the Shopping Cart Models
"""
from decimal import Decimal
import datetime
import os
import smtplib
from boto.exception import BotoServerError # this is a super-class of SESError and catches connection errors
@@ -233,7 +234,10 @@ 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
devnull = open(os.devnull, 'w')
with patch('sys.stderr', devnull):
cart.purchase()
self.assertTrue(CourseEnrollment.is_enrolled(self.user, self.course_key))
# test e-mail sending