(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
This commit is contained in:
Alex Hall 2021-06-09 19:03:44 +02:00
parent 8bf26a4433
commit 8138cc3123

View File

@ -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):