Skip to content
Permalink
Browse files

enable relation editor widget test on Qt5

  • Loading branch information
3nids committed Aug 15, 2016
1 parent 866617c commit c800ab46e901317c1005d7d0b8da585693bbb212
@@ -3,7 +3,6 @@ PyQgsJSONUtils
PyQgsLocalServer
PyQgsMapUnitScale
PyQgsPalLabelingServer
PyQgsRelationEditWidget
PyQgsServer
PyQgsServerAccessControl
PyQgsSipCoverage
@@ -438,7 +438,10 @@ void QgsRelationEditorWidget::unlinkFeature()
QgsFeatureIds fids;

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

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

@@ -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
@@ -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
@@ -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)
@@ -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()

0 comments on commit c800ab4

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