@@ -173,24 +173,24 @@ class InsertIntoWithDict(unittest.TestCase):
173
173
table_abc = Table ("abc" )
174
174
175
175
def test_inserting_simple_dictionary (self ):
176
- q = Query () .into (self .table_abc ).insert_dict ({"c1" : "value" , "c2" : 1 })
176
+ q = Query .into (self .table_abc ).insert_dict ({"c1" : "value" , "c2" : 1 })
177
177
self .assertEqual ("INSERT INTO \" abc\" (\" c1\" ,\" c2\" ) VALUES ('value',1)" , str (q ))
178
178
179
179
def test_inserting_dictionary_goes_through_value_quoting_logic (self ):
180
- q = Query () .into (self .table_abc ).insert_dict ({"num" : 1 , "timestamp" : datetime (2023 , 4 , 18 )})
180
+ q = Query .into (self .table_abc ).insert_dict ({"num" : 1 , "timestamp" : datetime (2023 , 4 , 18 )})
181
181
self .assertEqual ("INSERT INTO \" abc\" (\" num\" ,\" timestamp\" ) VALUES (1,'2023-04-18T00:00:00')" , str (q ))
182
182
183
183
def test_inserting_dictionary_produces_builder (self ):
184
- q = Query () .into (self .table_abc ).insert_dict ({"num" : 1 , "timestamp" : datetime (2023 , 4 , 18 )})
184
+ q = Query .into (self .table_abc ).insert_dict ({"num" : 1 , "timestamp" : datetime (2023 , 4 , 18 )})
185
185
q = q .insert (2 , datetime (2023 , 4 , 19 ))
186
186
self .assertEqual ("INSERT INTO \" abc\" (\" num\" ,\" timestamp\" ) VALUES (1,'2023-04-18T00:00:00'),(2,'2023-04-19T00:00:00')" , str (q ))
187
187
188
188
def test_columns_is_not_allowed_with_insert_dict (self ):
189
189
with self .assertRaises (QueryException ):
190
- Query () .into (self .table_abc ).columns ("a" , "b" ).insert_dict ({"num" : 1 })
190
+ Query .into (self .table_abc ).columns ("a" , "b" ).insert_dict ({"num" : 1 })
191
191
192
192
with self .assertRaises (QueryException ):
193
- Query () .into (self .table_abc ).insert_dict ({"num" : 1 }).columns ("a" , "b" )
193
+ Query .into (self .table_abc ).insert_dict ({"num" : 1 }).columns ("a" , "b" )
194
194
195
195
class PostgresInsertIntoOnConflictTests (unittest .TestCase ):
196
196
table_abc = Table ("abc" )
0 commit comments