The ContentType repr() incorrectly used , instead of ;.

This commit is contained in:
Robert Collins 2013-02-21 14:08:55 +13:00
parent 65bfef955e
commit 990176b4fa
3 changed files with 8 additions and 2 deletions

6
NEWS
View File

@ -25,6 +25,12 @@ Improvements
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
------------

View File

@ -29,7 +29,7 @@ class ContentType(object):
def __repr__(self):
if self.parameters:
params = '; '
params += ', '.join(
params += '; '.join(
sorted('%s="%s"' % (k, v) for k, v in self.parameters.items()))
else:
params = ''

View File

@ -43,7 +43,7 @@ class TestContentType(TestCase):
content_type = ContentType(
'text', 'plain', {'foo': 'bar', 'baz': 'qux'})
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):