Commit d2e6f6dc by Don Mitchell

Fixes for code review comments

parent 3a6f43f3
...@@ -141,7 +141,8 @@ def create_entry(key, value): ...@@ -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): ...@@ -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")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment