allow services to call /api/user to identify themselves

This commit is contained in:
Min RK
2020-12-02 12:21:25 +01:00
parent ff15ced3ce
commit f8040209b0
2 changed files with 16 additions and 1 deletions

View File

@@ -277,6 +277,17 @@ async def test_get_self(app):
assert r.status_code == 403
async def test_get_self_service(app, mockservice):
r = await api_request(
app, "user", headers={"Authorization": f"token {mockservice.api_token}"}
)
r.raise_for_status()
service_info = r.json()
assert service_info['kind'] == 'service'
assert service_info['name'] == mockservice.name
@mark.user
async def test_add_user(app):
db = app.db