Hashing fix3356

Fix for #3356 
I think this should use `assert_raise_message` seeing as we want to ensure that the message is helpful (this was the complaint in #3356).