1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00

add test for aexecutemany

This commit is contained in:
Flavio Curella 2024-11-12 12:06:02 -06:00
parent b9d81ffa64
commit 2d9ad58ccf
No known key found for this signature in database
GPG Key ID: 1AD0556F485696BF

View File

@ -11,6 +11,17 @@ class AsyncCursorTests(SimpleTestCase):
async with conn.acursor() as cursor:
await cursor.aexecute("SELECT 1")
async def test_aexecutemany(self):
async with new_connection() as conn:
async with conn.acursor() as cursor:
await cursor.aexecute("CREATE TABLE numbers (number SMALLINT)")
await cursor.aexecutemany(
"INSERT INTO numbers VALUES (%s)", [(1,), (2,), (3,)]
)
await cursor.aexecute("SELECT * FROM numbers")
result = await cursor.afetchall()
self.assertEqual(result, [(1,), (2,), (3,)])
async def test_afetchone(self):
async with new_connection() as conn:
async with conn.acursor() as cursor: