Fixes for code review comments
This commit is contained in:
@@ -141,7 +141,8 @@ def create_entry(key, value):
|
|||||||
|
|
||||||
|
|
||||||
def delete_entry(index):
|
def delete_entry(index):
|
||||||
""" index is 0-based
|
"""
|
||||||
|
Delete the nth entry where index is 0-based
|
||||||
"""
|
"""
|
||||||
css = '.delete-button'
|
css = '.delete-button'
|
||||||
assert_true(world.browser.is_element_present_by_css(css, 5))
|
assert_true(world.browser.is_element_present_by_css(css, 5))
|
||||||
|
|||||||
@@ -1263,11 +1263,11 @@ def course_advanced_updates(request, org, course, name):
|
|||||||
else:
|
else:
|
||||||
real_method = request.method
|
real_method = request.method
|
||||||
|
|
||||||
if request.method == 'GET':
|
if real_method == 'GET':
|
||||||
return HttpResponse(json.dumps(CourseMetadata.fetch(location)), mimetype="application/json")
|
return HttpResponse(json.dumps(CourseMetadata.fetch(location)), mimetype="application/json")
|
||||||
elif real_method == 'DELETE':
|
elif real_method == 'DELETE':
|
||||||
return HttpResponse(json.dumps(CourseMetadata.delete_key(location, json.loads(request.body))), mimetype="application/json")
|
return HttpResponse(json.dumps(CourseMetadata.delete_key(location, json.loads(request.body))), mimetype="application/json")
|
||||||
elif request.method == 'POST':
|
elif real_method == 'POST' or real_method == 'PUT':
|
||||||
# NOTE: request.POST is messed up because expect_json cloned_request.POST.copy() is creating a defective entry w/ the whole payload as the key
|
# NOTE: request.POST is messed up because expect_json cloned_request.POST.copy() is creating a defective entry w/ the whole payload as the key
|
||||||
return HttpResponse(json.dumps(CourseMetadata.update_from_json(location, json.loads(request.body))), mimetype="application/json")
|
return HttpResponse(json.dumps(CourseMetadata.update_from_json(location, json.loads(request.body))), mimetype="application/json")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user