Skip to content
Permalink
Browse files

Update TestQgsComposerLabel

  • Loading branch information
nyalldawson committed Aug 7, 2016
1 parent b160f10 commit 90fd4d4e647993ce1bfdfa95d3b97aa2a39f946c
Showing with 7 additions and 8 deletions.
  1. +7 −8 tests/src/python/test_qgscomposerlabel.py
@@ -69,18 +69,17 @@ def evaluation_test(self, mComposition, mLabel):
assert mLabel.displayText() == "__[NAME_1]42__"

def feature_evaluation_test(self, mComposition, mLabel, mVectorLayer):
provider = mVectorLayer.dataProvider()
atlas = mComposition.atlasComposition()
atlas.setCoverageLayer(mVectorLayer)
atlas.setEnabled(True)
mComposition.setAtlasMode(QgsComposition.ExportAtlas)

fi = provider.getFeatures(QgsFeatureRequest())
feat = QgsFeature()

fi.nextFeature(feat)
mLabel.setExpressionContext(feat, mVectorLayer)
mLabel.setText("[%\"NAME_1\"||'_ok'%]")
atlas.beginRender()
atlas.prepareForFeature(0)
assert mLabel.displayText() == "Basse-Normandie_ok"

fi.nextFeature(feat)
mLabel.setExpressionContext(feat, mVectorLayer)
atlas.prepareForFeature(1)
assert mLabel.displayText() == "Bretagne_ok"

def page_evaluation_test(self, mComposition, mLabel, mVectorLayer):

0 comments on commit 90fd4d4

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