Skip to content
Snippets Groups Projects
Commit f51b787e authored by Ruben Young On's avatar Ruben Young On
Browse files

API tests now check for status codes instead of messages

parent 0fec37c9
No related branches found
No related tags found
1 merge request!16Add API tests, small fix for MultipleChoiceOption
Pipeline #18158 passed
......@@ -51,7 +51,7 @@ def test_not_present(test_client, add_test_data):
result = test_client.get('/api/mult-choice/1')
data = json.loads(result.data)
assert data['message'] == "Multiple choice question with id 1 does not exist."
assert data['status'] == 404
def test_add(test_client, add_test_data):
......@@ -110,7 +110,7 @@ def test_update_put(test_client, add_test_data):
result = test_client.patch(f'/api/mult-choice/{id}', data=req2)
data = json.loads(result.data)
assert data['message'] == f'Multiple choice question with id {id} updated'
assert data['status'] == 200
def test_delete(test_client, add_test_data):
......@@ -132,7 +132,7 @@ def test_delete_not_present(test_client, add_test_data):
response = test_client.delete(f'/api/mult-choice/{id}')
data = json.loads(response.data)
assert data['message'] == f'Multiple choice question with id {id} does not exist.'
assert data['status'] == 404
def test_delete_finalized_exam(test_client, add_test_data):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment