43 lines
2.1 KiB
Python
43 lines
2.1 KiB
Python
# -*- coding: utf-8 -*-
|
|
|
|
from odoo.tests.common import TransactionCase
|
|
|
|
|
|
class TestBasicFunctionality(TransactionCase):
|
|
"""Basic smoke tests to verify the module loads and core methods exist"""
|
|
|
|
def setUp(self):
|
|
super(TestBasicFunctionality, self).setUp()
|
|
self.StockMoveLine = self.env['stock.move.line']
|
|
self.QualityCheck = self.env['quality.check']
|
|
|
|
def test_stock_move_line_model_exists(self):
|
|
"""Test that stock.move.line model can be accessed"""
|
|
self.assertIsNotNone(self.StockMoveLine, "stock.move.line model should be accessible")
|
|
self.assertEqual(self.StockMoveLine._name, 'stock.move.line')
|
|
|
|
def test_quality_check_model_exists(self):
|
|
"""Test that quality.check model can be accessed"""
|
|
self.assertIsNotNone(self.QualityCheck, "quality.check model should be accessible")
|
|
self.assertEqual(self.QualityCheck._name, 'quality.check')
|
|
|
|
def test_stock_move_line_has_custom_methods(self):
|
|
"""Test that custom methods exist on stock.move.line"""
|
|
# Create a dummy move line to test methods exist
|
|
move_line = self.StockMoveLine.new({})
|
|
self.assertTrue(hasattr(move_line, '_is_receipt_operation'),
|
|
"stock.move.line should have _is_receipt_operation method")
|
|
self.assertTrue(hasattr(move_line, '_update_quality_check_lot'),
|
|
"stock.move.line should have _update_quality_check_lot method")
|
|
|
|
def test_quality_check_has_custom_methods(self):
|
|
"""Test that custom methods exist on quality.check"""
|
|
# Create a dummy quality check to test methods exist
|
|
quality_check = self.QualityCheck.new({})
|
|
self.assertTrue(hasattr(quality_check, '_is_receipt_operation'),
|
|
"quality.check should have _is_receipt_operation method")
|
|
self.assertTrue(hasattr(quality_check, '_should_preserve_state'),
|
|
"quality.check should have _should_preserve_state method")
|
|
self.assertTrue(hasattr(quality_check, '_update_lot_from_move_line_manual'),
|
|
"quality.check should have _update_lot_from_move_line_manual method")
|