The ContentType repr() incorrectly used , instead of ;.
This commit is contained in:
6
NEWS
6
NEWS
@@ -25,6 +25,12 @@ Improvements
|
|||||||
|
|
||||||
A simple bug fix, and better error messages when you don't up-call.
|
A simple bug fix, and better error messages when you don't up-call.
|
||||||
|
|
||||||
|
Changes
|
||||||
|
-------
|
||||||
|
|
||||||
|
* ``testtools.content_type.ContentType`` incorrectly used ',' rather than ';'
|
||||||
|
to separate parameters. (Robert Collins)
|
||||||
|
|
||||||
Improvements
|
Improvements
|
||||||
------------
|
------------
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class ContentType(object):
|
|||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
if self.parameters:
|
if self.parameters:
|
||||||
params = '; '
|
params = '; '
|
||||||
params += ', '.join(
|
params += '; '.join(
|
||||||
sorted('%s="%s"' % (k, v) for k, v in self.parameters.items()))
|
sorted('%s="%s"' % (k, v) for k, v in self.parameters.items()))
|
||||||
else:
|
else:
|
||||||
params = ''
|
params = ''
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class TestContentType(TestCase):
|
|||||||
content_type = ContentType(
|
content_type = ContentType(
|
||||||
'text', 'plain', {'foo': 'bar', 'baz': 'qux'})
|
'text', 'plain', {'foo': 'bar', 'baz': 'qux'})
|
||||||
self.assertThat(
|
self.assertThat(
|
||||||
repr(content_type), Equals('text/plain; baz="qux", foo="bar"'))
|
repr(content_type), Equals('text/plain; baz="qux"; foo="bar"'))
|
||||||
|
|
||||||
|
|
||||||
class TestBuiltinContentTypes(TestCase):
|
class TestBuiltinContentTypes(TestCase):
|
||||||
|
|||||||
Reference in New Issue
Block a user