Fixing tests in Python 3

There are still two errors to go with static assets view. Since there is another branch dealing it, I just send this pull-request first to continue.