Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
891b9a64
Commit
891b9a64
authored
6 years ago
by
John Eskew
Browse files
Options
Downloads
Patches
Plain Diff
Add a test for multiple learner states.
parent
e7bdbe68
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openedx/core/djangoapps/user_api/accounts/tests/test_views.py
+13
-1
13 additions, 1 deletion
...edx/core/djangoapps/user_api/accounts/tests/test_views.py
with
13 additions
and
1 deletion
openedx/core/djangoapps/user_api/accounts/tests/test_views.py
+
13
−
1
View file @
891b9a64
...
...
@@ -1263,7 +1263,7 @@ class TestAccountRetirementList(RetirementTestCase):
except
AttributeError
:
states_to_request
=
states_to_request
data
=
{
'
cool_off_days
'
:
cool_off_days
,
'
states
'
:
'
,
'
.
join
(
states_to_request
)
}
data
=
{
'
cool_off_days
'
:
cool_off_days
,
'
states
'
:
states_to_request
}
response
=
self
.
client
.
get
(
self
.
url
,
data
,
**
self
.
headers
)
self
.
assertEqual
(
response
.
status_code
,
expected_status
)
response_data
=
response
.
json
()
...
...
@@ -1291,6 +1291,18 @@ class TestAccountRetirementList(RetirementTestCase):
self
.
_create_retirement
(
state
)
self
.
assert_status_and_user_list
([],
states_to_request
=
self
.
_get_non_dead_end_states
())
def
test_users_retrieved_in_multiple_states
(
self
):
"""
Verify that if multiple states are requested, learners in each state are returned.
"""
multiple_states
=
[
'
PENDING
'
,
'
FORUMS_COMPLETE
'
]
for
state
in
multiple_states
:
self
.
_create_retirement
(
RetirementState
.
objects
.
get
(
state_name
=
state
))
data
=
{
'
cool_off_days
'
:
0
,
'
states
'
:
multiple_states
}
response
=
self
.
client
.
get
(
self
.
url
,
data
,
**
self
.
headers
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_200_OK
)
self
.
assertEqual
(
len
(
response
.
json
()),
2
)
def
test_users_exist
(
self
):
"""
Verify users in different states are returned with correct data or filtered out
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment