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
20ae12ff
Commit
20ae12ff
authored
Jun 23, 2015
by
Xavier Antoviaque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't stop with --all when one of the course doesn't have cohorted discussions
parent
77848913
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletions
+27
-1
lms/djangoapps/django_comment_client/management/commands/export_discussion_participation.py
+4
-1
lms/djangoapps/django_comment_client/tests/management/test_export_discussion_participation.py
+23
-0
No files found.
lms/djangoapps/django_comment_client/management/commands/export_discussion_participation.py
View file @
20ae12ff
...
@@ -153,7 +153,10 @@ class Command(BaseCommand):
...
@@ -153,7 +153,10 @@ class Command(BaseCommand):
raw_course_key
,
raw_course_key
,
dir_name
/
self
.
get_default_file_location
(
raw_course_key
)
dir_name
/
self
.
get_default_file_location
(
raw_course_key
)
]
]
self
.
dump_one
(
*
args
,
**
options
)
try
:
self
.
dump_one
(
*
args
,
**
options
)
except
CommandError
as
e
:
print
(
'Error generating CSV for course {}: {}'
.
format
(
raw_course_key
,
e
.
message
))
def
dump_one
(
self
,
*
args
,
**
options
):
def
dump_one
(
self
,
*
args
,
**
options
):
if
not
args
:
if
not
args
:
...
...
lms/djangoapps/django_comment_client/tests/management/test_export_discussion_participation.py
View file @
20ae12ff
...
@@ -96,6 +96,29 @@ class CommandTest(TestCase):
...
@@ -96,6 +96,29 @@ class CommandTest(TestCase):
self
.
assertIn
(
'test_dir/social_stats_course-v1SandboxSandboxSandbox'
,
calls
[
1
][
0
][
1
])
self
.
assertIn
(
'test_dir/social_stats_course-v1SandboxSandboxSandbox'
,
calls
[
1
][
0
][
1
])
self
.
assertIn
(
'test_dir/social_stats_course-v1TestTestyTestify'
,
calls
[
2
][
0
][
1
])
self
.
assertIn
(
'test_dir/social_stats_course-v1TestTestyTestify'
,
calls
[
2
][
0
][
1
])
def
test_all_cohortedonly_options_together
(
self
,
patched_get_course
):
""" Ensure the 'all' option doesn't stop when one of the course doesn't have cohorted discussions """
self
.
set_up_default_mocks
(
patched_get_course
)
type
(
patched_get_course
.
return_value
)
.
cohort_config
=
mock
.
PropertyMock
(
return_value
=
{
'cohorted_inline_discussions'
:
[]}
)
self
.
command
.
get_all_courses
=
mock
.
Mock
()
course_list
=
[
mock
.
Mock
()
for
__
in
range
(
0
,
3
)]
locator_list
=
[
CourseLocator
(
org
=
"edX"
,
course
=
"demoX"
,
run
=
"now"
),
CourseLocator
(
org
=
"Sandbox"
,
course
=
"Sandbox"
,
run
=
"Sandbox"
),
CourseLocator
(
org
=
"Test"
,
course
=
"Testy"
,
run
=
"Testify"
),
]
for
index
,
course
in
enumerate
(
course_list
):
course
.
location
.
course_key
=
locator_list
[
index
]
self
.
command
.
get_all_courses
.
return_value
=
course_list
self
.
command
.
handle
(
"test_dir"
,
all
=
True
,
cohorted_only
=
True
,
dummy
=
'test'
)
calls
=
patched_get_course
.
call_args_list
self
.
assertEqual
(
len
(
calls
),
3
)
self
.
assertEqual
(
calls
[
0
][
0
][
0
],
locator_list
[
0
])
self
.
assertEqual
(
calls
[
1
][
0
][
0
],
locator_list
[
1
])
self
.
assertEqual
(
calls
[
2
][
0
][
0
],
locator_list
[
2
])
@ddt.data
(
"edX/demoX/now"
,
"otherX/CourseX/later"
)
@ddt.data
(
"edX/demoX/now"
,
"otherX/CourseX/later"
)
def
test_handle_writes_to_correct_location_when_output_file_not_specified
(
self
,
course_key
,
patched_get_course
):
def
test_handle_writes_to_correct_location_when_output_file_not_specified
(
self
,
course_key
,
patched_get_course
):
""" Tests that when no explicit filename is given data is exported to default location """
""" Tests that when no explicit filename is given data is exported to default location """
...
...
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