From 990176b4facf50a956dd07d300fe55954cc50b0c Mon Sep 17 00:00:00 2001 From: Robert Collins Date: Thu, 21 Feb 2013 14:08:55 +1300 Subject: [PATCH] The ContentType repr() incorrectly used , instead of ;. --- NEWS | 6 ++++++ testtools/content_type.py | 2 +- testtools/tests/test_content_type.py | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 2dde023..dcbf1a4 100644 --- a/NEWS +++ b/NEWS @@ -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 ------------ diff --git a/testtools/content_type.py b/testtools/content_type.py index c491408..bbf314b 100644 --- a/testtools/content_type.py +++ b/testtools/content_type.py @@ -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 = '' diff --git a/testtools/tests/test_content_type.py b/testtools/tests/test_content_type.py index ecb8e3a..2d34f95 100644 --- a/testtools/tests/test_content_type.py +++ b/testtools/tests/test_content_type.py @@ -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):