Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
17 additions
and
1 deletion.
-
+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 |
|
|
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.