def test_post_sorting(self):
        """Posts should be sorted chronologically."""
        now = datetime.now()
        t = ThreadFactory(posts=[{'created': now - timedelta(days=n)} for n in [0, 1, 4, 7, 11]])
        posts = t.post_set.all()
        for i in range(len(posts) - 1):
            self.assert_(posts[i].created <= posts[i + 1].created)
dataset/ETHPy150Open mozilla/kitsune/kitsune/forums/tests/test_posts.py/PostTestCase.test_post_sorting/original