Files
odoo_source/addons/spreadsheet_dashboard/tests/test_spreadsheet_dashboard.py
T
Lucas Lefèvre a7fe381f71 [REF] spreadsheet_dashboard: remove badly named raw field
Up until now, the collaborative expected a field named `raw` containing
the serialized json data. This is historic and appeared because the field
containing the existing field `raw` on `document.document` contained this
data.

The name `raw` is meaningless. Now the collaborative expects a field
named `spreadsheet_data`.
I chose a field over a custom method because fields are more broadly
supported everywhere (web client services, web client mocks)

closes odoo/odoo#104167

Related: odoo/upgrade#4005
Related: odoo/enterprise#33246
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-01-20 20:58:01 +01:00

20 lines
670 B
Python

from odoo.tests.common import TransactionCase
class TestSpreadsheetDashboard(TransactionCase):
def test_create_with_default_values(self):
group = self.env["spreadsheet.dashboard.group"].create(
{"name": "a group"}
)
dashboard = self.env["spreadsheet.dashboard"].create(
{
"name": "a dashboard",
"dashboard_group_id": group.id,
}
)
self.assertEqual(dashboard.group_ids, self.env.ref("base.group_user"))
self.assertEqual(
dashboard.spreadsheet_data,
'{"version": 1, "sheets": [{"id": "sheet1", "name": "Sheet1"}]}',
)