Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: comments: Fix flaky sort order
In isso/views/comments.py:feed() we are adding a "<thr:in-reply-to>" element: ``` ET.SubElement(entry, 'thr:in-reply-to', { 'ref': '[...]', 'href': '[...], }) ``` This dict is unsorted an can be emitted in either order when generating "/feed". Fix this by normalizing the generated data with str.replace(). Fixes error(abridged): ``` Traceback (most recent call last): File "/home/user/isso/isso/tests/test_comments.py", line 389, in testFeed self.assertEqual(data, """<?xml version=\'1.0\' encoding=\'utf-8\'?> AssertionError: '<?xm[537 chars]y-to ref="tag:example.org,2018:/isso/1/1" href[295 chars]eed>' \ != '<?xm[537 chars]y-to href="https://example.org/path/#isso-1" r[295 chars]eed>' ```
- Loading branch information