@ -20,7 +20,7 @@ try:
except ImportError :
except ImportError :
_logger . debug ( ' Cannot `import checksumdir`. ' )
_logger . debug ( ' Cannot `import checksumdir`. ' )
model = ' openerp.addons.module_auto_update.models.module '
model = ' openerp.addons.module_auto_update.models.module_deprecated '
class TestModule ( TransactionCase ) :
class TestModule ( TransactionCase ) :
@ -141,6 +141,7 @@ class TestModule(TransactionCase):
def test_create ( self ) :
def test_create ( self ) :
""" It should call _store_checksum_installed method """
""" It should call _store_checksum_installed method """
_store_checksum_installed_mock = mock . MagicMock ( )
_store_checksum_installed_mock = mock . MagicMock ( )
try :
self . env [ ' ir.module.module ' ] . _patch_method (
self . env [ ' ir.module.module ' ] . _patch_method (
' _store_checksum_installed ' ,
' _store_checksum_installed ' ,
_store_checksum_installed_mock ,
_store_checksum_installed_mock ,
@ -151,6 +152,7 @@ class TestModule(TransactionCase):
}
}
self . create_test_module ( vals )
self . create_test_module ( vals )
_store_checksum_installed_mock . assert_called_once_with ( vals )
_store_checksum_installed_mock . assert_called_once_with ( vals )
finally :
self . env [ ' ir.module.module ' ] . _revert_method (
self . env [ ' ir.module.module ' ] . _revert_method (
' _store_checksum_installed ' ,
' _store_checksum_installed ' ,
)
)