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
2077d4dc
Commit
2077d4dc
authored
Jan 07, 2015
by
David Baumgold
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6439 from edx/improve-shoppingcart-tests
Change tests so they show failures better.
parents
8af54943
4571930b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
lms/djangoapps/shoppingcart/tests/test_views.py
+6
-6
No files found.
lms/djangoapps/shoppingcart/tests/test_views.py
View file @
2077d4dc
...
...
@@ -467,7 +467,7 @@ class ShoppingCartViewsTests(ModuleStoreTestCase):
coupon_admin
=
SoftDeleteCouponAdmin
(
Coupon
,
AdminSite
())
test_query_set
=
coupon_admin
.
queryset
(
request
)
test_actions
=
coupon_admin
.
get_actions
(
request
)
self
.
assert
True
(
'really_delete_selected'
in
test_actions
[
'really_delete_selected'
])
self
.
assert
In
(
'really_delete_selected'
,
test_actions
[
'really_delete_selected'
])
self
.
assertEqual
(
get_coupon
.
is_active
,
True
)
coupon_admin
.
really_delete_selected
(
request
,
test_query_set
)
# pylint: disable=no-member
for
coupon
in
test_query_set
:
...
...
@@ -1486,28 +1486,28 @@ class RegistrationCodeRedemptionCourseEnrollment(ModuleStoreTestCase):
response
=
self
.
client
.
get
(
redeem_url
)
self
.
assertEquals
(
response
.
status_code
,
200
)
# check button text
self
.
assert
True
(
'Activate Course Enrollment'
in
response
.
content
)
self
.
assert
In
(
'Activate Course Enrollment'
,
response
.
content
)
#now activate the user by enrolling him/her to the course
response
=
self
.
client
.
post
(
redeem_url
)
self
.
assertEquals
(
response
.
status_code
,
200
)
self
.
assert
True
(
'View Dashboard'
in
response
.
content
)
self
.
assert
In
(
'View Dashboard'
,
response
.
content
)
#now check that the registration code has already been redeemed and user is already registered in the course
RegistrationCodeRedemption
.
objects
.
filter
(
registration_code__code
=
registration_code
)
response
=
self
.
client
.
get
(
redeem_url
)
self
.
assertEquals
(
len
(
RegistrationCodeRedemption
.
objects
.
filter
(
registration_code__code
=
registration_code
)),
1
)
self
.
assert
True
(
"You've clicked a link for an enrollment code that has already been used."
in
response
.
content
)
self
.
assert
In
(
"You've clicked a link for an enrollment code that has already been used."
,
response
.
content
)
#now check that the registration code has already been redeemed
response
=
self
.
client
.
post
(
redeem_url
)
self
.
assert
True
(
"You've clicked a link for an enrollment code that has already been used."
in
response
.
content
)
self
.
assert
In
(
"You've clicked a link for an enrollment code that has already been used."
,
response
.
content
)
#now check the response of the dashboard page
dashboard_url
=
reverse
(
'dashboard'
)
response
=
self
.
client
.
get
(
dashboard_url
)
self
.
assertEquals
(
response
.
status_code
,
200
)
self
.
assert
True
(
self
.
course
.
display_name
,
response
.
content
)
self
.
assert
In
(
self
.
course
.
display_name
,
response
.
content
)
@override_settings
(
MODULESTORE
=
MODULESTORE_CONFIG
)
...
...
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