Skip to content
Permalink
Browse files

Fix test

  • Loading branch information
m-kuhn committed Jul 23, 2018
1 parent 3e09118 commit 330db17b29e846649e53fc0682faf5628038884f
Showing with 17 additions and 1 deletion.
  1. +17 −1 tests/src/python/test_qgsrelationeditwidget.py
@@ -34,7 +34,13 @@
)

from qgis.PyQt.QtCore import QTimer
from qgis.PyQt.QtWidgets import QToolButton, QTableView, QApplication
from qgis.PyQt.QtWidgets import (
QToolButton,
QMessageBox,
QDialogButtonBox,
QTableView,
QApplication
)
from qgis.testing import start_app, unittest

start_app()
@@ -108,6 +114,16 @@ def test_delete_feature(self):
self.widget.featureSelectionManager().select([fid])

btn = self.widget.findChild(QToolButton, 'mDeleteFeatureButton')

def clickOk():
# Click the "Delete features" button on the confirmation message
# box
widget = self.widget.findChild(QMessageBox)
buttonBox = widget.findChild(QDialogButtonBox)
deleteButton = next((b for b in buttonBox.buttons() if buttonBox.buttonRole(b) == QDialogButtonBox.AcceptRole))
deleteButton.click()

QTimer.singleShot(1, clickOk)
btn.click()

# This is the important check that the feature is deleted

0 comments on commit 330db17

Please sign in to comment.
You can’t perform that action at this time.