32 lines
1.4 KiB
Python
32 lines
1.4 KiB
Python
# Part of Beyond. Collina Systems proprietary module.
|
|
from odoo.modules.module import get_manifest
|
|
from odoo.tests import TransactionCase, tagged
|
|
from odoo.tools import file_open
|
|
|
|
|
|
@tagged('post_install', '-at_install')
|
|
class TestBeyondPosThemeAssets(TransactionCase):
|
|
"""Fase 0 (spike D1): el tema queda registrado en el bundle del POS y
|
|
sus archivos existen. La evaluación visual es manual contra las pantallas
|
|
de referencia (ADR-001)."""
|
|
|
|
def test_assets_declarados_en_bundle_pos(self):
|
|
manifest = get_manifest('beyond_pos_theme')
|
|
bundle = manifest['assets'].get('point_of_sale._assets_pos', [])
|
|
self.assertIn('beyond_pos_theme/static/src/scss/beyond_pos.scss', bundle)
|
|
self.assertIn('beyond_pos_theme/static/src/xml/product_card.xml', bundle)
|
|
|
|
def test_archivos_del_tema_existen(self):
|
|
for path in (
|
|
'beyond_pos_theme/static/src/scss/beyond_pos.scss',
|
|
'beyond_pos_theme/static/src/xml/product_card.xml',
|
|
):
|
|
with file_open(path) as handle:
|
|
self.assertTrue(handle.read().strip(), f"{path} está vacío")
|
|
|
|
def test_herencia_extiende_product_card(self):
|
|
with file_open('beyond_pos_theme/static/src/xml/product_card.xml') as handle:
|
|
contenido = handle.read()
|
|
self.assertIn('t-inherit="point_of_sale.ProductCard"', contenido)
|
|
self.assertIn('t-inherit-mode="extension"', contenido)
|