MCPcopy Index your code
hub / github.com/geldata/gel / test_sql_dml_insert_02

Method test_sql_dml_insert_02

tests/test_sql_dml.py:121–140  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

119 self.assertEqual(res, [['Meeting report (new)']])
120
121 async def test_sql_dml_insert_02(self):
122 # when columns are not specified, all columns are expected,
123 # in alphabetical order:
124 # id, __type__, owner, title
125
126 await self.scon.execute("SET LOCAL allow_user_specified_id TO TRUE")
127 with self.assertRaisesRegex(
128 asyncpg.DataError,
129 "cannot assign to link '__type__': it is protected",
130 # TODO: positions are hard to recover since we don't even know which
131 # DML stmt this error is originating from
132 # position="30",
133 ):
134 await self.scon.execute(
135 '''
136 INSERT INTO "Document" VALUES (NULL, NULL, NULL, 'Report')
137 '''
138 )
139 res = await self.squery_values('SELECT title FROM "Document"')
140 self.assertEqual(res, [['Report (new)']])
141
142 async def test_sql_dml_insert_03(self):
143 # multiple rows at once

Callers

nothing calls this directly

Calls 3

executeMethod · 0.80
squery_valuesMethod · 0.80
assertRaisesRegexMethod · 0.45

Tested by

no test coverage detected