mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Adding traceback to trigger formulas
Summary: Traceback is available on the Creator Panel in the formula editor. It is evaluated the same way as for normal formulas. In case when the traceback is not available, only the error name is displayed with information that traceback is not available. Cell with an error, when edited, shows the previous valid value that was used before the error happened (or None for new rows). Value is stored inside the RaisedException object that is stored in a cell. Test Plan: Created tests Reviewers: alexmojaki Reviewed By: alexmojaki Subscribers: alexmojaki, dsagal Differential Revision: https://phab.getgrist.com/D3033
This commit is contained in:
@@ -12,6 +12,7 @@ import engine
|
||||
import logger
|
||||
import useractions
|
||||
import testutil
|
||||
import objtypes
|
||||
|
||||
log = logger.Logger(__name__, logger.DEBUG)
|
||||
|
||||
@@ -262,6 +263,13 @@ class EngineTestCase(unittest.TestCase):
|
||||
for tbl in list_of_tables
|
||||
for col in tbl.columns))
|
||||
|
||||
def assertFormulaError(self, exc, type_, message, tracebackRegexp=None):
|
||||
self.assertIsInstance(exc, objtypes.RaisedException)
|
||||
self.assertIsInstance(exc.error, type_)
|
||||
self.assertEqual(str(exc.error), message)
|
||||
if tracebackRegexp:
|
||||
self.assertRegex(exc.details, tracebackRegexp)
|
||||
|
||||
def assertViews(self, list_of_views):
|
||||
"""
|
||||
Verifies that the given View test-records correspond to the metadata for views/sections/fields.
|
||||
|
||||
Reference in New Issue
Block a user