Test for location header

Using BytesIO instead of StringIO to mock content due to the unicode
need of the latter
Tests for charset in Content-Type