          assert mediatype.precedence == 1
  
      def test_mediatype_string_representation(self):
          mediatype = _MediaType('test/*; foo=bar')
          params_str = ''
          for key, val in mediatype.params.items():
              params_str += '; %s=%s' % (key, val)
          expected = 'test/*' + params_str
          assert str(mediatype) == expected
  
      def test_raise_error_if_no_suitable_renderers_found(self):
          class MockRenderer(object):
              format = 'xml'
          renderers = [MockRenderer()]
 
</s> remove             ret += "; %s=%s" % (key, val)
 </s> add             ret += "; %s=%s" % (key, val.decode('ascii')) </s> remove         self.assertInHTML('<tr><th>Items</th><td>a string</td></tr>', str(response.content))
 </s> add         self.assertContains(response, '<tr><th>Items</th><td>a string</td></tr>', html=True) </s> remove         self.assertInHTML('<tr><th>Foo</th><td>a string</td></tr>', str(response.content))
 </s> add         self.assertContains(response, '<tr><th>Foo</th><td>a string</td></tr>', html=True) </s> remove         self.assertInHTML('<tr><th>Iteritems</th><td>a string</td></tr>', str(response.content))
 </s> add         self.assertContains(response, '<tr><th>Iteritems</th><td>a string</td></tr>', html=True)
        assert str(mediatype) == 'test/*; foo=bar'
          assert mediatype.precedence == 1
  
      def test_mediatype_string_representation(self):
          mediatype = _MediaType('test/*; foo=bar')
        assert str(mediatype) == 'test/*; foo=bar'
        assert str(mediatype) == 'test/*; foo=bar'
        assert str(mediatype) == 'test/*; foo=bar'
        assert str(mediatype) == 'test/*; foo=bar'
        assert str(mediatype) == 'test/*; foo=bar'
  
      def test_raise_error_if_no_suitable_renderers_found(self):
          class MockRenderer(object):
              format = 'xml'
          renderers = [MockRenderer()]
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
 Fix all BytesWarning caught during tests (#5561)

Running the tests with bytes warning enabled shows some bytes/str
mixups. Fix them all.

Some examples of mixing usage:

str(b'foo') -- calling str() on bytes
b'foo' == 'foo' -- compare str with bytes
'foo' + b'bar' -- concatenating str and bytes 
tests/test_negotiation.py