Fix #736 Python Error when assigning data type using Key Editor. Also ensure qgis is imported for all tools tests
Merge remote-tracking branch 'upstream/master'

merge remote-tracking branch master