Skip to content

Commit 400e4f7

Browse files
committed
Update tests
1 parent 4fcbce1 commit 400e4f7

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

isso/tests/test_comments.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,10 @@ def testGetSortedByNewestWithNested(self):
347347

348348
rv = loads(r.data)
349349
self.assertEqual(len(rv['replies']), 1)
350-
# assert order of nested comments is newest first
350+
# assert order of nested comments is oldest first
351351
self.assertEqual(
352352
[comment['id'] for comment in rv['replies'][0]['replies']],
353-
[6, 5, 4, 3, 2]
353+
[2, 3, 4, 5, 6]
354354
)
355355

356356
def testGetSortedByUpvotesWithNested(self):
@@ -369,10 +369,10 @@ def testGetSortedByUpvotesWithNested(self):
369369

370370
rv = loads(r.data)
371371
self.assertEqual(len(rv['replies']), 1)
372-
# assert order of nested comments is newest first
372+
# assert order of nested comments is oldest first
373373
self.assertEqual(
374374
[comment['id'] for comment in rv['replies'][0]['replies']],
375-
[6, 3, 2, 4, 5]
375+
[2, 3, 4, 5, 6]
376376
)
377377

378378
def testUpdate(self):
@@ -559,15 +559,15 @@ def testFeed(self):
559559

560560
rv = self.get('/feed?uri=%2Fpath%2F')
561561
self.assertEqual(rv.status_code, 200)
562-
self.assertEqual(rv.headers['ETag'], '"1-2"')
562+
self.assertEqual(rv.headers['ETag'], '"1-1"')
563563
data = rv.data.decode('utf-8')
564564
data = re.sub('[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]+Z',
565565
'2018-04-01T10:00:00Z', data)
566566
self.maxDiff = None
567567
# Two accepted outputs, since different versions of Python sort attributes in different order.
568568
self.assertIn(data, ["""<?xml version=\'1.0\' encoding=\'utf-8\'?>
569-
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0"><updated>2018-04-01T10:00:00Z</updated><id>tag:example.org,2018:/isso/thread/path/</id><title>Comments for example.org/path/</title><entry><id>tag:example.org,2018:/isso/1/2</id><title>Comment #2</title><updated>2018-04-01T10:00:00Z</updated><author><name /></author><link href="https://example.org/path/#isso-2" /><content type="html">&lt;p&gt;&lt;em&gt;Second&lt;/em&gt;&lt;/p&gt;</content><thr:in-reply-to href="https://example.org/path/#isso-1" ref="tag:example.org,2018:/isso/1/1" /></entry><entry><id>tag:example.org,2018:/isso/1/1</id><title>Comment #1</title><updated>2018-04-01T10:00:00Z</updated><author><name /></author><link href="https://example.org/path/#isso-1" /><content type="html">&lt;p&gt;First&lt;/p&gt;</content></entry></feed>""", """<?xml version=\'1.0\' encoding=\'utf-8\'?>
570-
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0"><updated>2018-04-01T10:00:00Z</updated><id>tag:example.org,2018:/isso/thread/path/</id><title>Comments for example.org/path/</title><entry><id>tag:example.org,2018:/isso/1/2</id><title>Comment #2</title><updated>2018-04-01T10:00:00Z</updated><author><name /></author><link href="https://example.org/path/#isso-2" /><content type="html">&lt;p&gt;&lt;em&gt;Second&lt;/em&gt;&lt;/p&gt;</content><thr:in-reply-to ref="tag:example.org,2018:/isso/1/1" href="https://example.org/path/#isso-1" /></entry><entry><id>tag:example.org,2018:/isso/1/1</id><title>Comment #1</title><updated>2018-04-01T10:00:00Z</updated><author><name /></author><link href="https://example.org/path/#isso-1" /><content type="html">&lt;p&gt;First&lt;/p&gt;</content></entry></feed>"""])
569+
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0"><updated>2018-04-01T10:00:00Z</updated><id>tag:example.org,2018:/isso/thread/path/</id><title>Comments for example.org/path/</title><entry><id>tag:example.org,2018:/isso/1/1</id><title>Comment #1</title><updated>2018-04-01T10:00:00Z</updated><author><name /></author><link href="https://example.org/path/#isso-1" /><content type="html">&lt;p&gt;First&lt;/p&gt;</content></entry><entry><id>tag:example.org,2018:/isso/1/2</id><title>Comment #2</title><updated>2018-04-01T10:00:00Z</updated><author><name /></author><link href="https://example.org/path/#isso-2" /><content type="html">&lt;p&gt;&lt;em&gt;Second&lt;/em&gt;&lt;/p&gt;</content><thr:in-reply-to href="https://example.org/path/#isso-1" ref="tag:example.org,2018:/isso/1/1" /></entry></feed>""", """<?xml version=\'1.0\' encoding=\'utf-8\'?>
570+
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0"><updated>2018-04-01T10:00:00Z</updated><id>tag:example.org,2018:/isso/thread/path/</id><title>Comments for example.org/path/</title><entry><id>tag:example.org,2018:/isso/1/1</id><title>Comment #1</title><updated>2018-04-01T10:00:00Z</updated><author><name /></author><link href="https://example.org/path/#isso-1" /><content type="html">&lt;p&gt;First&lt;/p&gt;</content></entry><entry><id>tag:example.org,2018:/isso/1/2</id><title>Comment #2</title><updated>2018-04-01T10:00:00Z</updated><author><name /></author><link href="https://example.org/path/#isso-2" /><content type="html">&lt;p&gt;&lt;em&gt;Second&lt;/em&gt;&lt;/p&gt;</content><thr:in-reply-to ref="tag:example.org,2018:/isso/1/1" href="https://example.org/path/#isso-1" /></entry></feed>"""])
571571

572572
def testCounts(self):
573573

0 commit comments

Comments
 (0)