diff --git a/src/towncrier/_builder.py b/src/towncrier/_builder.py index eecd7de5..b93550a1 100644 --- a/src/towncrier/_builder.py +++ b/src/towncrier/_builder.py @@ -119,7 +119,7 @@ def split_fragments(fragments, definitions): if definitions[category]["showcontent"] is False: content = u"" - texts = section.get(category, {}) + texts = section.get(category, OrderedDict()) if texts.get(content): texts[content] = sorted(texts[content] + [ticket]) diff --git a/src/towncrier/test/test_write.py b/src/towncrier/test/test_write.py index fd7a66d4..5205bb9b 100644 --- a/src/towncrier/test/test_write.py +++ b/src/towncrier/test/test_write.py @@ -17,14 +17,14 @@ class WritingTests(TestCase): def test_append_at_top(self): fragments = OrderedDict([ - ("", { - ("142", "misc", 0): u"", - ("1", "misc", 0): u"", - ("4", "feature", 0): u"Stuff!", - ("4", "feature", 1): u"Second Stuff!", - ("2", "feature", 0): u"Foo added.", - ("72", "feature", 0): u"Foo added.", - }), + ("", OrderedDict([ + (("142", "misc", 0), u""), + (("1", "misc", 0), u""), + (("4", "feature", 0), u"Stuff!"), + (("4", "feature", 1), u"Second Stuff!"), + (("2", "feature", 0), u"Foo added."), + (("72", "feature", 0), u"Foo added."), + ])), ("Names", {}), ("Web", { ("3", "bugfix", 0): u"Web fixed.",