Skip to content

Commit

Permalink
enable relation editor widget test on Qt5
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Aug 15, 2016
1 parent 866617c commit c800ab4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 0 additions & 1 deletion ci/travis/linux/qt5/blacklist.txt
Expand Up @@ -3,7 +3,6 @@ PyQgsJSONUtils
PyQgsLocalServer
PyQgsMapUnitScale
PyQgsPalLabelingServer
PyQgsRelationEditWidget
PyQgsServer
PyQgsServerAccessControl
PyQgsSipCoverage
Expand Down
3 changes: 3 additions & 0 deletions src/gui/qgsrelationeditorwidget.cpp
Expand Up @@ -438,7 +438,10 @@ void QgsRelationEditorWidget::unlinkFeature()
QgsFeatureIds fids;

while ( linkedIterator.nextFeature( f ) )
{
fids << f.id();
QgsDebugMsg( f.id() );
}

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

Expand Down
7 changes: 4 additions & 3 deletions tests/src/python/test_qgsrelationeditwidget.py
Expand Up @@ -49,7 +49,7 @@ def setUpClass(cls):
:return:
"""
QgsEditorWidgetRegistry.initEditors()
cls.dbconn = u'dbname=\'qgis_test\' host=localhost port=5432 user=\'postgres\' password=\'postgres\''
cls.dbconn = u'service=\'qgis_test\''
if 'QGIS_PGTEST_DB' in os.environ:
cls.dbconn = os.environ['QGIS_PGTEST_DB']
# Create test layer
Expand Down Expand Up @@ -125,7 +125,7 @@ def test_list(self):

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

@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...
@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...
def test_add_feature(self):
"""
Check if a new related feature is added
Expand Down Expand Up @@ -182,7 +182,6 @@ def test_unlink_feature(self):
Check if a linked feature can be unlinked
"""
wrapper = self.createWrapper(self.vl_b)
wdg = wrapper.widget() # NOQA

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

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

self.assertEqual(2, self.widget.featureSelectionManager().selectedFeatureCount())

btn = self.widget.findChild(QToolButton, 'mUnlinkFeatureButton')
btn.click()

Expand Down

0 comments on commit c800ab4

Please sign in to comment.