Skip to content

Commit c800ab4

Browse files
committed
enable relation editor widget test on Qt5
1 parent 866617c commit c800ab4

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

ci/travis/linux/qt5/blacklist.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ PyQgsJSONUtils
33
PyQgsLocalServer
44
PyQgsMapUnitScale
55
PyQgsPalLabelingServer
6-
PyQgsRelationEditWidget
76
PyQgsServer
87
PyQgsServerAccessControl
98
PyQgsSipCoverage

src/gui/qgsrelationeditorwidget.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,10 @@ void QgsRelationEditorWidget::unlinkFeature()
438438
QgsFeatureIds fids;
439439

440440
while ( linkedIterator.nextFeature( f ) )
441+
{
441442
fids << f.id();
443+
QgsDebugMsg( f.id() );
444+
}
442445

443446
mRelation.referencingLayer()->deleteFeatures( fids );
444447

tests/src/python/test_qgsrelationeditwidget.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def setUpClass(cls):
4949
:return:
5050
"""
5151
QgsEditorWidgetRegistry.initEditors()
52-
cls.dbconn = u'dbname=\'qgis_test\' host=localhost port=5432 user=\'postgres\' password=\'postgres\''
52+
cls.dbconn = u'service=\'qgis_test\''
5353
if 'QGIS_PGTEST_DB' in os.environ:
5454
cls.dbconn = os.environ['QGIS_PGTEST_DB']
5555
# Create test layer
@@ -125,7 +125,7 @@ def test_list(self):
125125

126126
self.assertEqual(self.table_view.model().rowCount(), 4)
127127

128-
@unittest.expectedFailure(os.environ['QT_VERSION'] == '4' and os.environ['TRAVIS_OS_NAME'] == 'linux') # It's probably not related to this variables at all, but that's the closest we can get to the real source of this problem at the moment...
128+
@unittest.expectedFailure(os.environ['QT_VERSION'] == '4' and os.environ['TRAVIS_OS_NAME'] == 'linux') # It's probably not related to this variables at all, but that's the closest we can get to the real source of this problem at the moment...
129129
def test_add_feature(self):
130130
"""
131131
Check if a new related feature is added
@@ -182,7 +182,6 @@ def test_unlink_feature(self):
182182
Check if a linked feature can be unlinked
183183
"""
184184
wrapper = self.createWrapper(self.vl_b)
185-
wdg = wrapper.widget() # NOQA
186185

187186
# All authors are listed
188187
self.assertEqual(self.table_view.model().rowCount(), 4)
@@ -192,6 +191,8 @@ def test_unlink_feature(self):
192191

193192
self.widget.featureSelectionManager().select([f.id() for f in it])
194193

194+
self.assertEqual(2, self.widget.featureSelectionManager().selectedFeatureCount())
195+
195196
btn = self.widget.findChild(QToolButton, 'mUnlinkFeatureButton')
196197
btn.click()
197198

0 commit comments

Comments
 (0)