pyceo/tests/ceod/api/test_members.py

24 lines
554 B
Python
Raw Normal View History

2021-08-13 20:11:56 -04:00
import pytest
def test_members_get_user(client):
status, data = client.get('/api/members/no_such_user')
assert status == 404
assert data['error'] == 'user not found'
@pytest.fixture(scope='session')
def create_user_resp(client):
return client.post('/api/members', json={
'uid': 'test_jdoe',
'cn': 'John Doe',
'program': 'Math',
'terms': ['s2021'],
})
# def test_create_user(create_user_resp):
# status, data = create_user_resp
# assert status == 200
# # TODO: check response contents