def METHOD_NAME(app, test_communities, login_user):
    """Test that scheduling files happens properly."""
    task_args = dict(
        max_count=0, max_size=0,
        batch_interval={'seconds': 1}, frequency={'seconds': 1}
    )
    with app.app_context():
        b1 = Bucket.create()
        objects = []
        for i in range(10):
            objects.append(
                ObjectVersion.create(b1, str(i), stream=BytesIO(b'test')))
        db.session.commit()
        # corrupt 1 file
        corrupted_file = objects[0].file
        with open(corrupted_file.uri, 'w') as file_writer:
            file_writer.write('modified content')
        # schedule all files
        schedule_checksum_verification(**task_args)
        # assert that all will be checked
        assert not corrupted_file.last_check
        for o in objects[1:]:
            assert o.file.last_check
        # make 1 file fail
        failed_file = objects[1].file
        failed_file.last_check = None
        # schedule all failed
        schedule_failed_checksum_files(**task_args)
        # assert that 1 wiil run again
        assert failed_file.last_check
        assert not corrupted_file.last_check