Esempio n. 1
0
def test_organization_validator(qtbot, core_config):
    switch_language(core_config, "en")

    le = ValidatedLineEdit()
    le.set_validator(validators.OrganizationIDValidator())
    qtbot.addWidget(le)
    le.show()

    qtbot.keyClicks(le, "Reynholm")
    assert le.is_input_valid()
    assert le.property("validity") == QtGui.QValidator.Acceptable

    qtbot.keyClicks(le, " Industries")
    assert not le.is_input_valid()
    assert le.property("validity") == QtGui.QValidator.Invalid
 def __init__(self):
     super().__init__()
     self.setupUi(self)
     self.line_edit_user_email.validity_changed.connect(self.check_infos)
     self.line_edit_user_email.set_validator(validators.EmailValidator())
     self.line_edit_user_full_name.textChanged.connect(self.check_infos)
     self.line_edit_org_name.validity_changed.connect(self.check_infos)
     self.line_edit_org_name.set_validator(
         validators.OrganizationIDValidator())
     self.line_edit_backend_addr.set_validator(
         validators.BackendAddrValidator())
     self.line_edit_backend_addr.validity_changed.connect(self.check_infos)
     self.check_accept_contract.clicked.connect(self.check_infos)
     self.check_use_custom_backend.clicked.connect(
         self._on_use_custom_backend_clicked)
     self.widget_custom_backend.hide()
Esempio n. 3
0
 def __init__(self):
     super().__init__()
     self.setupUi(self)
     self.line_edit_user_email.validity_changed.connect(self.check_infos)
     self.line_edit_user_email.set_validator(validators.EmailValidator())
     self.line_edit_user_full_name.textChanged.connect(self.check_infos)
     self.line_edit_org_name.validity_changed.connect(self.check_infos)
     self.line_edit_org_name.set_validator(
         validators.OrganizationIDValidator())
     self.line_edit_backend_addr.set_validator(
         validators.BackendAddrValidator())
     self.line_edit_backend_addr.validity_changed.connect(self.check_infos)
     self.check_accept_contract.clicked.connect(self.check_infos)
     self.radio_use_commercial.toggled.connect(self._switch_server)
     self.radio_use_custom.toggled.connect(self._switch_server)
     self.radio_use_commercial.setChecked(True)