Files
Odoo-18.0-20251222/database_cleanup/tests/test_identifier_adapter.py
tocmo0nlord adbe430761
Some checks failed
pre-commit / pre-commit (push) Has been cancelled
tests / Detect unreleased dependencies (push) Has been cancelled
tests / test with OCB (push) Has been cancelled
tests / test with Odoo (push) Has been cancelled
Initial commit: Odoo 18.0-20251222 extra-addons
2026-03-13 20:43:25 +00:00

19 lines
637 B
Python
Executable File

from odoo.tests import TransactionCase
from odoo.addons.database_cleanup.identifier_adapter import IdentifierAdapter
class TestIdentifierAdapter(TransactionCase):
def test_column_name_with_spaces(self):
"""Spaces in column names are preserved except in unquoted identifiers."""
self.assertEqual(
self.env.cr.mogrify("%s", (IdentifierAdapter("snailmail_cover "),)),
b'"snailmail_cover "',
)
self.assertEqual(
self.env.cr.mogrify(
"%s", (IdentifierAdapter("snailmail_cover ", quote=False),)
),
b"snailmail_cover",
)