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
98eb7645
Commit
98eb7645
authored
Sep 04, 2012
by
ichuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleaned up instructor dashboard CSV unit test code, per
https://github.com/MITx/mitx/pull/615
parent
0c3d0542
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
14 deletions
+12
-14
lms/djangoapps/instructor/tests.py
+12
-14
No files found.
lms/djangoapps/instructor/tests.py
View file @
98eb7645
...
...
@@ -65,22 +65,20 @@ class TestInstructorDashboardGradeDownloadCSV(ct.PageLoader):
course
=
self
.
toy
url
=
reverse
(
'instructor_dashboard'
,
kwargs
=
{
'course_id'
:
course
.
id
})
msg
=
"url =
%
s
\n
"
%
url
resp
=
self
.
client
.
post
(
url
,
{
'action'
:
'Download CSV of all student grades for this course'
,
})
msg
+=
"instructor dashboard download csv grades: resp = '
%
s'"
%
resp
response
=
self
.
client
.
post
(
url
,
{
'action'
:
'Download CSV of all student grades for this course'
,
})
msg
+=
"instructor dashboard download csv grades: response = '
%
s'
\n
"
%
response
respstr
=
str
(
resp
)
.
replace
(
'
\r
'
,
''
)
respstr
=
respstr
.
replace
(
'TT_2012'
,
'2012'
)
# jenkins course_id is TT_2012_Fall instead of 2012_Fall?
#open('idtest.out','w').write(respstr)
self
.
assertEqual
(
response
[
'Content-Type'
],
'text/csv'
,
msg
)
expected_resp
=
'''Vary: Cookie
Content-Type: text/csv
Content-Disposition: attachment; filename=grades_edX/toy/2012_Fall.csv
Cache-Control: no-cache, no-store, must-revalidate
cdisp
=
response
[
'Content-Disposition'
]
.
replace
(
'TT_2012'
,
'2012'
)
# jenkins course_id is TT_2012_Fall instead of 2012_Fall?
msg
+=
"cdisp = '
%
s'
\n
"
%
cdisp
self
.
assertEqual
(
cdisp
,
'attachment; filename=grades_edX/toy/2012_Fall.csv'
,
msg
)
"ID","Username","Full Name","edX email","External email","HW 01","HW 02","HW 03","HW 04","HW 05","HW 06","HW 07","HW 08","HW 09","HW 10","HW 11","HW 12","HW Avg","Lab 01","Lab 02","Lab 03","Lab 04","Lab 05","Lab 06","Lab 07","Lab 08","Lab 09","Lab 10","Lab 11","Lab 12","Lab Avg","Midterm","Final"
body
=
response
.
content
.
replace
(
'
\r
'
,
''
)
msg
+=
"body = '
%
s'
\n
"
%
body
expected_body
=
'''"ID","Username","Full Name","edX email","External email","HW 01","HW 02","HW 03","HW 04","HW 05","HW 06","HW 07","HW 08","HW 09","HW 10","HW 11","HW 12","HW Avg","Lab 01","Lab 02","Lab 03","Lab 04","Lab 05","Lab 06","Lab 07","Lab 08","Lab 09","Lab 10","Lab 11","Lab 12","Lab Avg","Midterm","Final"
"2","u2","Fred Weasley","view2@test.com","","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0.0","0.0"
'''
self
.
assertEqual
(
respstr
,
expected_resp
,
msg
)
self
.
assertEqual
(
body
,
expected_body
,
msg
)
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