@ -154,33 +154,33 @@ class TestModule(TransactionCase):
)
)
@mock.patch ( ' %s .get_module_path ' % model )
@mock.patch ( ' %s .get_module_path ' % model )
def test_updat e_list ( self , get_ module_path_mock) :
def test_get_modul e_list ( self , module_path_mock ) :
""" It should change the state of modules with different
""" It should change the state of modules with different
checksum_dir and checksum_installed to ' to upgrade ' """
checksum_dir and checksum_installed to ' to upgrade ' """
get_ module_path_mock. return_value = self . own_dir_path
module_path_mock . return_value = self . own_dir_path
vals = {
vals = {
' name ' : ' module_auto_update_test_module ' ,
' name ' : ' module_auto_update_test_module ' ,
' state ' : ' installed ' ,
' state ' : ' installed ' ,
}
}
test_module = self . create_test_module ( vals )
test_module = self . create_test_module ( vals )
test_module . checksum_installed = ' test '
test_module . checksum_installed = ' test '
self . env [ ' ir.module.modul e' ] . updat e_list( )
self . env [ ' base.module.upgrad e' ] . get_modul e_list( )
self . assertEqual (
self . assertEqual (
test_module . state , ' to upgrade ' ,
test_module . state , ' to upgrade ' ,
' List update does not mark upgradeable modules " to upgrade " ' ,
' List update does not mark upgradeable modules " to upgrade " ' ,
)
)
@mock.patch ( ' %s .get_module_path ' % model )
@mock.patch ( ' %s .get_module_path ' % model )
def test_updat e_list_only_changes_installed ( self , get_ module_path_mock) :
def test_get_modul e_list_only_changes_installed ( self , module_path_mock ) :
""" It should not change the state of a module with a former state
""" It should not change the state of a module with a former state
other than ' installed ' to ' to upgrade ' """
other than ' installed ' to ' to upgrade ' """
get_ module_path_mock. return_value = self . own_dir_path
module_path_mock . return_value = self . own_dir_path
vals = {
vals = {
' name ' : ' module_auto_update_test_module ' ,
' name ' : ' module_auto_update_test_module ' ,
' state ' : ' uninstalled ' ,
' state ' : ' uninstalled ' ,
}
}
test_module = self . create_test_module ( vals )
test_module = self . create_test_module ( vals )
self . env [ ' ir.module.modul e' ] . updat e_list( )
self . env [ ' base.module.upgrad e' ] . get_modul e_list( )
self . assertNotEqual (
self . assertNotEqual (
test_module . state , ' to upgrade ' ,
test_module . state , ' to upgrade ' ,
' List update changed state of an uninstalled module ' ,
' List update changed state of an uninstalled module ' ,