Use my lazr.config megamerge branch for now, even though it's still under
[mailman.git] / mailman / queue / docs / archiver.txt
blobed7c26d4582ab32acae02867a0684ecf75728c61
1 Archiving
2 =========
4 Mailman can archive to any number of archivers that adhere to the IArchiver
5 interface.  By default, there's a Pipermail archiver.
7     >>> from mailman.app.lifecycle import create_list
8     >>> mlist = create_list(u'test@example.com')
9     >>> mlist.web_page_url = u'http://www.example.com/'
10     >>> config.db.commit()
12     >>> msg = message_from_string("""\
13     ... From: aperson@example.com
14     ... To: test@example.com
15     ... Subject: My first post
16     ... Message-ID: <first>
17     ...
18     ... First post!
19     ... """)
21     >>> archiver_queue = config.switchboards['archive']
22     >>> ignore = archiver_queue.enqueue(msg, {}, listname=mlist.fqdn_listname)
24     >>> from mailman.queue.archive import ArchiveRunner
25     >>> from mailman.testing.helpers import make_testable_runner
26     >>> runner = make_testable_runner(ArchiveRunner)
27     >>> runner.run()
29     # The best we can do is verify some landmark exists.  Let's use the
30     # Pipermail pickle file exists.
31     >>> listname = mlist.fqdn_listname
32     >>> import os
33     >>> os.path.exists(os.path.join(
34     ...     config.PUBLIC_ARCHIVE_FILE_DIR, listname, 'pipermail.pck'))
35     True