def test_binary_with_encoding(): b = Binary( content=b'something', mimetype='image/gif', encoding='utf8', ) assert mimetest(b.mime()).encoding == 'utf8'
def test_binary_with_encoding(): b = Binary( content=b'something', mimetype='image/gif', encoding='utf-8', ) mime = mimetest(b.mime()) assert mime.encoding == 'utf-8'
def test_headers_priority(self): b = Binary(content=self.content, mimetype=self.expected_mimetype, headers={'Content-Type': 'text/plain'}) mime = mimetest(b.mime()) assert mime['Content-Type'] == 'text/plain'
def enclosure(self): return Binary( content=self.content, mimetype=self.expected_mimetype, headers=self.headers, )