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:
parent
b9d81ffa64
commit
2d9ad58ccf
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user