コード例 #1
0
    def test_validation(self):
        provider = self.create_credit_provider()
        editor = CreditProviderEditor(self.store, provider)

        editor.max_installments.set_value(-1)
        self.assertInvalid(editor, ['max_installments'])
        self.assertNotSensitive(editor.main_dialog, ['ok_button'])
        editor.max_installments.set_value(0)
        self.assertInvalid(editor, ['max_installments'])
        self.assertNotSensitive(editor.main_dialog, ['ok_button'])
        editor.max_installments.set_value(1)
        self.assertValid(editor, ['max_installments'])
        self.assertSensitive(editor.main_dialog, ['ok_button'])
コード例 #2
0
 def test_show(self):
     provider = self.create_credit_provider()
     editor = CreditProviderEditor(self.store, provider)
     self.check_editor(editor, 'editor-creditprovidereditor-show')