add some tests for db.find_ratings
This commit is contained in:
parent
a17b49bc0b
commit
e1f35143df
4 changed files with 195 additions and 8 deletions
|
|
@ -10,11 +10,8 @@ pytestmark = pytest.mark.asyncio
|
|||
app = create_app()
|
||||
|
||||
|
||||
async def test_app():
|
||||
await db.open_connection_pool()
|
||||
conn = db.shared_connection()
|
||||
|
||||
async with conn.transaction(force_rollback=True):
|
||||
async def test_app(shared_conn):
|
||||
async with shared_conn.transaction(force_rollback=True):
|
||||
|
||||
# https://www.starlette.io/testclient/
|
||||
client = TestClient(app)
|
||||
|
|
@ -58,5 +55,3 @@ async def test_app():
|
|||
response = client.get("/api/v1/movies", params={"unwind_id": str(m.id)})
|
||||
assert response.status_code == 200
|
||||
assert response.json() == [m_plain]
|
||||
|
||||
await db.close_connection_pool()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue