1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from proteus import Model, Wizard
from .common import ProteusTestCase
class TestWizard(ProteusTestCase):
def test_translation_clean(self):
translation_clean = Wizard('ir.translation.clean')
self.assertEqual(translation_clean.form.__class__.__name__,
'ir.translation.clean.start')
translation_clean.execute('clean')
self.assertEqual(translation_clean.form.__class__.__name__,
'ir.translation.clean.succeed')
def test_translation_export(self):
Lang = Model.get('ir.lang')
Module = Model.get('ir.module')
translation_export = Wizard('ir.translation.export')
translation_export.form.language, = Lang.find([('code', '=', 'en')])
translation_export.form.module, = Module.find([('name', '=', 'ir')])
translation_export.execute('export')
self.assertTrue(translation_export.form.file)
translation_export.execute('end')
def test_user_config(self):
User = Model.get('res.user')
user_config = Wizard('res.user.config')
user_config.execute('user')
user_config.form.name = 'Foo'
user_config.form.login = 'foo'
user_config.execute('add')
self.assertEqual(user_config.form.name, None)
self.assertEqual(user_config.form.login, None)
user_config.form.name = 'Bar'
user_config.form.login = 'bar'
user_config.execute('end')
self.assertTrue(User.find([('name', '=', 'Foo')]))
self.assertFalse(User.find([('name', '=', 'Bar')]))
def test_translation_update(self):
print_model_graph = Wizard('ir.translation.update')
self.assertEqual(len(print_model_graph.actions), 0)
print_model_graph.execute('update')
self.assertEqual(len(print_model_graph.actions), 1)
def test_configuration_wizard(self):
config_wizard = Wizard('ir.module.config_wizard')
config_wizard.execute('action')
self.assertTrue(config_wizard.actions)
|