From 8138cc312368804dc6ed1b84a234e69bb7d43c48 Mon Sep 17 00:00:00 2001 From: Alex Hall Date: Wed, 9 Jun 2021 19:03:44 +0200 Subject: [PATCH] (core) Make regression tests by recording pycalls when opening fixture docs Summary: Records all sandbox pycall arguments and results, saves them to JSON when the environment variable UPDATE_REGRESSION_DATA is set, otherwise checks that they match the saved JSON. Test Plan: This is tests Reviewers: dsagal, paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D2851 --- sandbox/grist/objtypes.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sandbox/grist/objtypes.py b/sandbox/grist/objtypes.py index af55c398..aed859ac 100644 --- a/sandbox/grist/objtypes.py +++ b/sandbox/grist/objtypes.py @@ -172,6 +172,8 @@ def encode_object(value): return str(value) elif isinstance(value, records.Record): return ['R', value._table.table_id, value._row_id] + elif isinstance(value, RecordStub): + return ['R', value.table_id, value.row_id] elif isinstance(value, datetime): return ['D', moment.dt_to_ts(value), value.tzinfo.zone.name if value.tzinfo else 'UTC'] elif isinstance(value, date):