Skip to content
Permalink
Browse files

Python3 compat fix for composerhtml test

  • Loading branch information
m-kuhn committed Apr 23, 2016
1 parent c0a2be7 commit adf42dab542ab5702440ddbb4a99ea41dd37b1cf
Showing with 3 additions and 4 deletions.
  1. +3 −4 tests/src/python/test_qgscomposerhtml.py
@@ -142,16 +142,15 @@ def testComposerHtmlAccessor(self):
myComposition = QgsComposition(self.iface.mapCanvas().mapRenderer())
mySubstitutionMap = {'replace-me': 'Foo bar'}
myFile = os.path.join(TEST_DATA_DIR, 'template.qpt')
myTemplateFile = file(myFile, 'rt')
myTemplateContent = myTemplateFile.read()
myTemplateFile.close()
with open(myFile, 'rt') as myTemplateFile:
myTemplateContent = myTemplateFile.read()
myDocument = QDomDocument()
myDocument.setContent(myTemplateContent)
myComposition.loadFromTemplate(myDocument, mySubstitutionMap)
myItem = myComposition.getComposerItemById('html-test')
myComposerHtml = myComposition.getComposerHtmlByItem(myItem)
myMessage = 'Could not retrieve the composer html given an item'
assert myComposerHtml is not None, myMessage
self.assertIsNotNone(myComposerHtml, myMessage)

if __name__ == '__main__':
unittest.main()

0 comments on commit adf42da

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