File tree 2 files changed +4
-7
lines changed
2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -124,13 +124,10 @@ def experience():
124
124
return jsonify ([exp .__dict__ for exp in data ["experience" ]]), 200
125
125
126
126
if request .method == "POST" :
127
- request_body = (
128
- request .form
129
- if request .content_type == "multipart/form-data"
130
- else request .get_json ()
131
- )
127
+ request_body = request .form
128
+
132
129
if not request_body :
133
- return jsonify ({"error" : "Request must be JSON or include form data" }), 400
130
+ return jsonify ({"error" : "Request must include form data" }), 400
134
131
135
132
required_fields = {
136
133
"title" : str ,
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ def test_experience(client):
69
69
"description" : "Writing JavaScript Code" ,
70
70
"logo" : "default.jpg" ,
71
71
}
72
- item_id = client .post ("/resume/experience" , json = example_experience ).json ["id" ]
72
+ item_id = client .post ("/resume/experience" , data = example_experience ).json ["id" ]
73
73
response = client .get ("/resume/experience" )
74
74
assert any (exp ["id" ] == item_id for exp in response .json )
75
75
You can’t perform that action at this time.
0 commit comments