Skip to content
Snippets Groups Projects
Commit 50a92d30 authored by inso's avatar inso
Browse files

Fix tests

parent ebc009d2
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@ import asyncio
from PyQt5.QtCore import Qt, QObject
from PyQt5.QtWidgets import QApplication
from sakia.constants import ROOT_SERVERS
from sakia.decorators import asyncify
from sakia.gui.sub.search_user.controller import SearchUserController
from sakia.gui.sub.user_information.controller import UserInformationController
......@@ -120,9 +121,10 @@ communication means and imitate the voice of the person.<br/>
<br/>
The 2°) is however preferable to the 3°)... whereas <b>1°) is mandatory in any case.</b><br/>
<br/>
<b>Reminder</b> : Certifying is not only uniquely ensuring that you met the person, its ensuring the {0} community
<b>Reminder</b> : Certifying is not only uniquely ensuring that you met the person, its ensuring the {:} community
that you know her well enough and that you will know how to find a double account done by a person certified by you
using cross checking which will help to reveal the problem if needs to be.</br>""")
using cross checking which will help to reveal the problem if needs to be.</br>""".format(
ROOT_SERVERS[self.model.app.currency]["display"]))
if result == dialogs.QMessageBox.No:
return
......
......@@ -67,8 +67,10 @@ class CertificationView(QDialog, Ui_CertificationDialog):
def set_label_confirm(self, currency):
self.label_confirm.setTextFormat(Qt.RichText)
self.label_confirm.setText("""<b>Vous confirmez engager votre responsabilité envers la communauté Duniter {0} et acceptez de certifier le compte Duniter Ğ1 ci-dessus.<br/><br/>
Pour confirmer votre certification veuillez confirmer votre signature :</b>""".format(ROOT_SERVERS[currency]["display"]))
self.label_confirm.setText("""<b>Vous confirmez engager votre responsabilité envers la communauté Duniter {:}
et acceptez de certifier le compte Duniter {:} ci-dessus.<br/><br/>
Pourconfirmer votre certification veuillez confirmer votre signature :</b>""".format(ROOT_SERVERS[currency]["display"],
ROOT_SERVERS[currency]["display"]))
async def show_success(self, notification):
if notification:
......
......@@ -5,6 +5,7 @@ from PyQt5.QtCore import QLocale, Qt, QEvent
from PyQt5.QtTest import QTest
from PyQt5.QtWidgets import QDialogButtonBox, QApplication, QMessageBox
from sakia.gui.dialogs.certification.controller import CertificationController
from ..helpers import click_on_top_message_box
@pytest.mark.asyncio
......@@ -38,6 +39,8 @@ async def test_certification_init_community(application_with_one_connection, fak
QTest.keyClicks(certification_dialog.password_input.view.edit_password, bob.password)
assert certification_dialog.view.button_box.button(QDialogButtonBox.Ok).isEnabled()
QTest.mouseClick(certification_dialog.view.button_box.button(QDialogButtonBox.Ok), Qt.LeftButton)
await asyncio.sleep(0.1)
click_on_top_message_box()
await asyncio.sleep(0.2)
assert isinstance(fake_server.forge.pool[0], Certification)
......
......@@ -5,13 +5,7 @@ from PyQt5.QtCore import Qt
from PyQt5.QtTest import QTest
from sakia.data.processors import ConnectionsProcessor
from sakia.gui.dialogs.connection_cfg import ConnectionConfigController
def click_on_top_message_box():
topWidgets = QApplication.topLevelWidgets()
for w in topWidgets:
if type(w) is QMessageBox:
QTest.keyClick(w, Qt.Key_Enter)
from ..helpers import click_on_top_message_box
def assert_key_parameters_behaviour(connection_config_dialog, user):
......
from PyQt5.QtWidgets import QApplication, QMessageBox
from PyQt5.QtCore import Qt
from PyQt5.QtTest import QTest
def click_on_top_message_box():
topWidgets = QApplication.topLevelWidgets()
for w in topWidgets:
if type(w) is QMessageBox:
QTest.keyClick(w, Qt.Key_Enter)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment