def test_reporting_reverse(self):
        Author.objects.create(id=10000)

        with captured_stdout() as output:
            qs = Author.objects.reverse()
            for authors in qs.iter_smart_chunks(report_progress=True,
                                                chunk_min=100):
                list(authors)  # fetch them

        lines = output.getvalue().split('\n')

        reports = lines[0].split('\r')
        assert len(reports) > 0
        for report in reports:
            assert re.match(
                r"^Author SmartChunkedIterator processed \d+/11 objects "
                r"\(\d+\.\d+%\) in \d+ chunks"
                r"(; lowest pk so far \d+(, [\dhms]+ remaining)?)?( )*$",
                report
            )

        assert re.match(
            r'Finished! Iterated over \d+ objects? in [\dhms]+.',
            lines[1],
        )
dataset/ETHPy150Open adamchainz/django-mysql/tests/testapp/test_models.py/SmartIteratorTests.test_reporting_reverse/original