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:
Eli Ribble 2016-05-04 07:16:05 -06:00
parent 69228f21ca
commit 6a2cb087fc
3 changed files with 32 additions and 3 deletions

View file

@ -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',
}