Fixes for code review comments

This commit is contained in:
Don Mitchell
2013-02-26 13:56:00 -05:00
parent 3a6f43f320
commit d2e6f6dccb
2 changed files with 4 additions and 3 deletions

View File

@@ -141,7 +141,8 @@ def create_entry(key, value):
def delete_entry(index):
""" index is 0-based
"""
Delete the nth entry where index is 0-based
"""
css = '.delete-button'
assert_true(world.browser.is_element_present_by_css(css, 5))

View File

@@ -1263,11 +1263,11 @@ def course_advanced_updates(request, org, course, name):
else:
real_method = request.method
if request.method == 'GET':
if real_method == 'GET':
return HttpResponse(json.dumps(CourseMetadata.fetch(location)), mimetype="application/json")
elif real_method == 'DELETE':
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
return HttpResponse(json.dumps(CourseMetadata.update_from_json(location, json.loads(request.body))), mimetype="application/json")