Fix exception tests

I found that two of the tests were failing because they were being passed a Mock object instead of 'utf-8' as the encoding.