Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
f2293b95
Commit
f2293b95
authored
Dec 18, 2014
by
Ben Patterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Quiet analytics.init stderr output for tests.
parent
0e58e7cb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
lms/djangoapps/shoppingcart/tests/test_models.py
+6
-7
No files found.
lms/djangoapps/shoppingcart/tests/test_models.py
View file @
f2293b95
...
...
@@ -636,12 +636,12 @@ class CertificateItemTest(ModuleStoreTestCase):
)
def
test_refund_cert_callback_no_expiration
(
self
):
# When there is no expiration date on a verified mode, the user can always get a refund
CourseEnrollment
.
enroll
(
self
.
user
,
self
.
course_key
,
'verified'
)
cart
=
Order
.
get_cart_for_user
(
user
=
self
.
user
)
CertificateItem
.
add_to_order
(
cart
,
self
.
course_key
,
self
.
cost
,
'verified'
)
# need to prevent analytics errors from appearing in stderr
with
patch
(
'sys.stderr'
,
sys
.
stdout
.
write
):
CourseEnrollment
.
enroll
(
self
.
user
,
self
.
course_key
,
'verified'
)
cart
=
Order
.
get_cart_for_user
(
user
=
self
.
user
)
CertificateItem
.
add_to_order
(
cart
,
self
.
course_key
,
self
.
cost
,
'verified'
)
cart
.
purchase
()
CourseEnrollment
.
unenroll
(
self
.
user
,
self
.
course_key
)
...
...
@@ -689,12 +689,11 @@ class CertificateItemTest(ModuleStoreTestCase):
expiration_datetime
=
(
datetime
.
datetime
.
now
(
pytz
.
utc
)
+
many_days
))
course_mode
.
save
()
CourseEnrollment
.
enroll
(
self
.
user
,
self
.
course_key
,
'verified'
)
cart
=
Order
.
get_cart_for_user
(
user
=
self
.
user
)
CertificateItem
.
add_to_order
(
cart
,
self
.
course_key
,
self
.
cost
,
'verified'
)
# need to prevent analytics errors from appearing in stderr
with
patch
(
'sys.stderr'
,
sys
.
stdout
.
write
):
CourseEnrollment
.
enroll
(
self
.
user
,
self
.
course_key
,
'verified'
)
cart
=
Order
.
get_cart_for_user
(
user
=
self
.
user
)
CertificateItem
.
add_to_order
(
cart
,
self
.
course_key
,
self
.
cost
,
'verified'
)
cart
.
purchase
()
CourseEnrollment
.
unenroll
(
self
.
user
,
self
.
course_key
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment