Add tests for #1136
Merge branch 'master' of github.com:sequelize/sequelize