1
0
forked from Mapan/odoo17e
odoo17e-kedaikipas58/addons/spreadsheet_edition/tests/spreadsheet_test_case.py
2024-12-10 09:04:09 +07:00

27 lines
875 B
Python

# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import TransactionCase
from uuid import uuid4
class SpreadsheetTestCase(TransactionCase):
def new_revision_data(self, spreadsheet, **kwargs):
return {
"id": spreadsheet.id,
"type": "REMOTE_REVISION",
"clientId": "john",
"commands": [{"type": "A_COMMAND"}],
"nextRevisionId": uuid4().hex,
"serverRevisionId": spreadsheet.server_revision_id,
**kwargs,
}
def snapshot(self, spreadsheet, server_revision_id, snapshot_revision_id, data):
return spreadsheet.dispatch_spreadsheet_message({
"type": "SNAPSHOT",
"nextRevisionId": snapshot_revision_id,
"serverRevisionId": server_revision_id,
"data": data,
})