Commit 4f6c921b authored by Luna's avatar Luna 😻

fix tests

tests that asserted upon rjson.success or 200 have been changed
to assert on 204 instead.
parent a4cb4c14
Pipeline #54526038 passed with stage
in 2 minutes and 11 seconds
......@@ -78,11 +78,7 @@ async def test_user_activate_cycle(test_cli):
'Authorization': atoken
})
assert resp.status == 200
rjson = await resp.json()
assert isinstance(rjson, dict)
assert rjson['success']
assert resp.status == 204
# check profile for deactivation
resp = await test_cli.get(f'/api/admin/users/{uid}', headers={
......@@ -98,11 +94,7 @@ async def test_user_activate_cycle(test_cli):
resp = await test_cli.post(f'/api/admin/activate/{uid}', headers={
'Authorization': atoken
})
assert resp.status == 200
rjson = await resp.json()
assert isinstance(rjson, dict)
assert rjson['success']
assert resp.status == 204
# check profile
resp = await test_cli.get(f'/api/admin/users/{uid}', headers={
......
......@@ -70,21 +70,21 @@ async def test_valid_token(test_cli):
async def test_revoke(test_cli):
token = await login_normal(test_cli)
response_valid = await test_cli.get('/api/profile', headers={
resp = await test_cli.get('/api/profile', headers={
'Authorization': token,
})
assert response_valid.status == 200
assert resp.status == 200
revoke_call = await test_cli.post('/api/revoke', json={
resp = await test_cli.post('/api/revoke', json={
'user': USERNAME,
'password': PASSWORD
})
assert revoke_call.status == 200
assert resp.status == 204
response_invalid = await test_cli.get('/api/profile', headers={
resp = await test_cli.get('/api/profile', headers={
'Authorization': token,
})
assert response_invalid.status == 403
assert resp.status == 403
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