Test additional parts of the sql.mak template
authorKarl O. Pinc <kop@karlpinc.com>
Sun, 29 Sep 2024 19:34:48 +0000 (14:34 -0500)
committerKarl O. Pinc <kop@karlpinc.com>
Sun, 29 Sep 2024 20:14:43 +0000 (15:14 -0500)
tests/templates/test_templates.py

index 6bfd9165d0164cfff8c43bd5ba7f8dfe87de95a6..315abd34e6279dcd654a0c338ddab919e8981ef1 100644 (file)
@@ -75,16 +75,29 @@ stock_template_args = {
 TEMPLATES = ['sql.mak', 'sql_edit.mak']
 logged_in_args = pgwui_develop.testing.update_copy(
     stock_template_args, {'havecreds': True})
+multiline_sql_args = pgwui_develop.testing.update_copy(
+    logged_in_args, {'sql': '''select * from bar;
+do $$
+  begin
+    raise exception using message = 'some error';
+  end;
+$$;
+select * from bar;''',
+                     'report_success': True,
+                     'upload_sql': False,
+                     'filename': ''})
 
 # Add the request to all the arguments.
 # (The request won't deepcopy, so we don't try.)
 stock_template_args['request'] = request
 logged_in_args['request'] = request
+multiline_sql_args['request'] = request
 
 # The variables with which to test each template
 TEMPLATE_ARGS = {
     'sql.mak': [stock_template_args,
-                logged_in_args],
+                logged_in_args,
+                multiline_sql_args],
     'sql_edit.mak': [stock_template_args,
                      logged_in_args]
 }