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
1b6e6634
Commit
1b6e6634
authored
5 years ago
by
Jeremy Bowman
Committed by
Feanil Patel
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix edxnotes stub tests BOM-633
parent
835a84f3
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/djangoapps/terrain/stubs/edxnotes.py
+4
-4
4 additions, 4 deletions
common/djangoapps/terrain/stubs/edxnotes.py
common/djangoapps/terrain/stubs/http.py
+1
-1
1 addition, 1 deletion
common/djangoapps/terrain/stubs/http.py
with
5 additions
and
5 deletions
common/djangoapps/terrain/stubs/edxnotes.py
+
4
−
4
View file @
1b6e6634
...
...
@@ -121,7 +121,7 @@ class StubEdxNotesServiceHandler(StubHttpRequestHandler):
}
if
status_code
<
400
and
content
:
headers
[
"
Content-Type
"
]
=
"
application/json
"
content
=
json
.
dumps
(
content
)
content
=
json
.
dumps
(
content
)
.
encode
(
'
utf-8
'
)
else
:
headers
[
"
Content-Type
"
]
=
"
text/html
"
...
...
@@ -131,7 +131,7 @@ class StubEdxNotesServiceHandler(StubHttpRequestHandler):
"""
Create a note, assign id, annotator_schema_version, created and updated dates.
"""
note
=
json
.
loads
(
self
.
request_content
)
note
=
json
.
loads
(
self
.
request_content
.
decode
(
'
utf-8
'
)
)
note
.
update
({
"
id
"
:
uuid4
().
hex
,
"
annotator_schema_version
"
:
"
v1.0
"
,
...
...
@@ -146,7 +146,7 @@ class StubEdxNotesServiceHandler(StubHttpRequestHandler):
The same as self._create, but it works a list of notes.
"""
try
:
notes
=
json
.
loads
(
self
.
request_content
)
notes
=
json
.
loads
(
self
.
request_content
.
decode
(
'
utf-8
'
)
)
except
ValueError
:
self
.
respond
(
400
,
"
Bad Request
"
)
return
...
...
@@ -181,7 +181,7 @@ class StubEdxNotesServiceHandler(StubHttpRequestHandler):
"""
Update the note by note id.
"""
note
=
self
.
server
.
update_note
(
note_id
,
json
.
loads
(
self
.
request_content
))
note
=
self
.
server
.
update_note
(
note_id
,
json
.
loads
(
self
.
request_content
.
decode
(
'
utf-8
'
)
))
if
note
:
self
.
respond
(
content
=
note
)
else
:
...
...
This diff is collapsed.
Click to expand it.
common/djangoapps/terrain/stubs/http.py
+
1
−
1
View file @
1b6e6634
...
...
@@ -92,7 +92,7 @@ class StubHttpRequestHandler(BaseHTTPRequestHandler, object):
Retrieve the content of the request.
"""
try
:
length
=
int
(
self
.
headers
.
get
header
(
'
content-length
'
))
length
=
int
(
self
.
headers
.
get
(
'
content-length
'
))
except
(
TypeError
,
ValueError
):
return
""
...
...
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