Files
odoo_source/addons/spreadsheet_dashboard/tests/test_spreadsheet_dashboard.py
T
Adrien Minne (adrm) c31032f415 [IMP] spreadsheet: update o_spreadsheet to latest version
https://github.com/odoo/o-spreadsheet/commit/7d15d3c7 [REL] 16.4.0-alpha.6
https://github.com/odoo/o-spreadsheet/commit/56f3b593 [IMP] spreadsheet: add locale handling Task: 3222401
https://github.com/odoo/o-spreadsheet/commit/5aec70d4 [IMP] cell: store date string as value + format Task: 3222401
https://github.com/odoo/o-spreadsheet/commit/eeaf0083 [IMP] icons: add display header icon
https://github.com/odoo/o-spreadsheet/commit/3f1e970c [FIX] SelectionInput: fix position of exclamation mark icon Task: 3355063
https://github.com/odoo/o-spreadsheet/commit/a46bf04e [FIX] LineBarPieConfigPanel: charts data series invalid input Task: 3355063

closes odoo/odoo#126679

Related: odoo/enterprise#43291
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-06-29 18:20:37 +02:00

35 lines
1.2 KiB
Python

import json
from odoo.tests.common import TransactionCase
from odoo.exceptions import UserError
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(
json.loads(dashboard.spreadsheet_data),
dashboard._empty_spreadsheet_data()
)
def test_unlink_prevent_spreadsheet_group(self):
group = self.env["spreadsheet.dashboard.group"].create(
{"name": "a_group"}
)
self.env['ir.model.data'].create({
'name': group.name,
'module': 'spreadsheet_dashboard',
'model': group._name,
'res_id': group.id,
})
with self.assertRaises(UserError, msg="You cannot delete a_group as it is used in another module"):
group.unlink()