Exemplo n.º 1
0
    def testConfirm(self):
        parameter_data = self.create_parameter_data()
        editor = SystemParameterEditor(self.store, parameter_data)

        parameter_data.field_value = None
        self.assertFalse(editor.validate_confirm())
        self.assertFalse(editor.confirm())

        editor.model.field_value = u'25'
        self.assertTrue(editor.confirm())
        self.check_editor(editor, 'editor-systemparameter-confirm',
                          [editor.retval])
Exemplo n.º 2
0
    def test_confirm(self):
        parameter_data = self.create_parameter_data()
        detail = sysparam.get_detail_by_name(parameter_data.field_name)
        editor = SystemParameterEditor(self.store, detail)

        parameter_data.field_value = None
        self.assertFalse(editor.validate_confirm())
        self.assertFalse(editor.confirm())

        editor.model.field_value = self.create_account().id
        self.assertTrue(editor.confirm())
        self.check_editor(editor, 'editor-systemparameter-confirm',
                          [editor.retval])
Exemplo n.º 3
0
 def test_unwrapped_text_view_entry(self):
     parameter_data = self.store.find(
         ParameterData,
         field_name=u'ADDITIONAL_INFORMATION_ON_COUPON').one()
     editor = SystemParameterEditor(self.store, parameter_data)
     self.check_editor(editor,
                       'editor-systemparameter-unwrapped-text-view-entry')
Exemplo n.º 4
0
 def test_filechooser(self):
     detail = ParameterDetails(u'FOO', 'section', 'short_desc', 'long_desc',
                               str, editor='directory-chooser')
     sysparam.register_param(detail)
     editor = SystemParameterEditor(self.store, detail)
     self.check_editor(editor, 'editor-systemparameter-file-chooser')
     sysparam._details.pop('FOO')
Exemplo n.º 5
0
 def test_unwrapped_text_view_entry(self):
     detail = ParameterDetails(u'FOO', 'section', 'short_desc', 'long_desc',
                               str, multiline=True, initial=u'bar',
                               wrap=False)
     sysparam.register_param(detail)
     editor = SystemParameterEditor(self.store, detail)
     self.check_editor(editor, 'editor-systemparameter-unwrapped-text-view-entry')
     sysparam._details.pop('FOO')
Exemplo n.º 6
0
 def test_create(self):
     parameter_data = self.create_parameter_data()
     editor = SystemParameterEditor(self.store, parameter_data)
     self.check_editor(editor, 'editor-systemparameter-show')
Exemplo n.º 7
0
 def test_options_combo(self):
     detail = sysparam.get_detail_by_name(u'SCALE_BARCODE_FORMAT')
     editor = SystemParameterEditor(self.store, detail)
     self.check_editor(editor, 'editor-systemparameter-options-combo')
Exemplo n.º 8
0
 def test_options_combo(self):
     parameter_data = self.store.find(ParameterData,
                                      field_name=u'NFE_DANFE_ORIENTATION').one()
     editor = SystemParameterEditor(self.store, parameter_data)
     self.check_editor(editor, 'editor-systemparameter-options-combo')
Exemplo n.º 9
0
 def test_image(self):
     parameter_data = self.store.find(ParameterData,
                                      field_name=u'CUSTOM_LOGO_FOR_REPORTS').one()
     editor = SystemParameterEditor(self.store, parameter_data)
     self.check_editor(editor, 'editor-systemparameter-image')
Exemplo n.º 10
0
 def test_spin_entry(self):
     parameter_data = self.store.find(ParameterData,
                                      field_name=u'MAX_SEARCH_RESULTS').one()
     editor = SystemParameterEditor(self.store, parameter_data)
     editor._entry.update(456)
     self.check_editor(editor, 'editor-systemparameter-spin-entry')
Exemplo n.º 11
0
 def test_spin_entry(self):
     detail = sysparam.get_detail_by_name(u'MAX_SEARCH_RESULTS')
     editor = SystemParameterEditor(self.store, detail)
     editor._entry.update(456)
     self.check_editor(editor, 'editor-systemparameter-spin-entry')
Exemplo n.º 12
0
 def test_combo_entry(self):
     detail = sysparam.get_detail_by_name(u'COUNTRY_SUGGESTED')
     editor = SystemParameterEditor(self.store, detail)
     self.check_editor(editor, 'editor-systemparameter-combo-entry')
Exemplo n.º 13
0
 def test_entry_insensitive(self):
     with self.sysparam(USER_HASH=u'45b27f4258024de58d2308753fcfff21'):
         detail = sysparam.get_detail_by_name(u'USER_HASH')
         editor = SystemParameterEditor(self.store, detail)
     self.check_editor(editor, 'editor-systemparameter-entry-insensitive')
Exemplo n.º 14
0
 def test_entry(self):
     detail = sysparam.get_detail_by_name(u'CITY_SUGGESTED')
     editor = SystemParameterEditor(self.store, detail)
     editor._entry.update('any city')
     self.check_editor(editor, 'editor-systemparameter-entry')
Exemplo n.º 15
0
 def test_create(self):
     parameter_data = self.create_parameter_data()
     detail = sysparam.get_detail_by_name(parameter_data.field_name)
     editor = SystemParameterEditor(self.store, detail)
     self.check_editor(editor, 'editor-systemparameter-show')
Exemplo n.º 16
0
 def test_entry(self):
     parameter_data = self.store.find(ParameterData,
                                      field_name=u'CITY_SUGGESTED').one()
     editor = SystemParameterEditor(self.store, parameter_data)
     editor._entry.update('any city')
     self.check_editor(editor, 'editor-systemparameter-entry')
Exemplo n.º 17
0
 def test_combo_entry(self):
     parameter_data = self.store.find(ParameterData,
                                      field_name=u'COUNTRY_SUGGESTED').one()
     editor = SystemParameterEditor(self.store, parameter_data)
     self.check_editor(editor, 'editor-systemparameter-combo-entry')
Exemplo n.º 18
0
 def test_text_view_entry(self):
     detail = sysparam.get_detail_by_name(u'BOOKLET_INSTRUCTIONS')
     editor = SystemParameterEditor(self.store, detail)
     self.check_editor(editor, 'editor-systemparameter-text-view-entry')
Exemplo n.º 19
0
 def test_text_view_entry(self):
     parameter_data = self.store.find(ParameterData,
                                      field_name=u'NFE_FISCO_INFORMATION').one()
     editor = SystemParameterEditor(self.store, parameter_data)
     self.check_editor(editor, 'editor-systemparameter-text-view-entry')
Exemplo n.º 20
0
 def test_image(self):
     detail = sysparam.get_detail_by_name(u'CUSTOM_LOGO_FOR_REPORTS')
     editor = SystemParameterEditor(self.store, detail)
     self.check_editor(editor, 'editor-systemparameter-image')
Exemplo n.º 21
0
 def test_radio(self):
     parameter_data = self.store.find(ParameterData,
                                      field_name=u'DISABLE_COOKIES').one()
     editor = SystemParameterEditor(self.store, parameter_data)
     self.check_editor(editor, 'editor-systemparameter-radio')
Exemplo n.º 22
0
 def test_radio(self):
     detail = sysparam.get_detail_by_name(u'DISABLE_COOKIES')
     editor = SystemParameterEditor(self.store, detail)
     self.check_editor(editor, 'editor-systemparameter-radio')
Exemplo n.º 23
0
 def test_filechooser(self):
     parameter_data = self.store.find(ParameterData,
                                      field_name=u'CAT52_DEST_DIR').one()
     editor = SystemParameterEditor(self.store, parameter_data)
     self.check_editor(editor, 'editor-systemparameter-file-chooser')
Exemplo n.º 24
0
 def test_entry_insensitive(self):
     with self.sysparam(USER_HASH=u'45b27f4258024de58d2308753fcfff21'):
         parameter_data = self.store.find(ParameterData,
                                          field_name=u'USER_HASH').one()
         editor = SystemParameterEditor(self.store, parameter_data)
     self.check_editor(editor, 'editor-systemparameter-entry-insensitive')