Add GET /user/ implementation that works
Previously my GET was just a placeholder so I could build URIs against it. Now it actually works and returns information on a user
This commit is contained in:
parent
69228f21ca
commit
6a2cb087fc
3 changed files with 32 additions and 3 deletions
|
@ -2,6 +2,8 @@ import json
|
|||
|
||||
import pytest
|
||||
|
||||
import vanth.platform.user
|
||||
|
||||
|
||||
@pytest.mark.usefixtures('db')
|
||||
def test_post(client):
|
||||
|
@ -13,3 +15,13 @@ def test_post(client):
|
|||
response = client.post('/user/', data=json.dumps(data))
|
||||
assert response.status_code == 204
|
||||
assert response.headers['Location']
|
||||
|
||||
@pytest.mark.usefixtures('db')
|
||||
def test_get(client):
|
||||
location = vanth.platform.user.create('Blue Stahli', 'blue@stahli.com', 'metamorphosis')
|
||||
response = client.get(location)
|
||||
assert response.status_code == 200
|
||||
assert response.json == {
|
||||
'name' : 'Blue Stahli',
|
||||
'username' : 'blue@stahli.com',
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue