summaryrefslogtreecommitdiff
path: root/src/mailman/testing
Commit message (Collapse)AuthorAgeFilesLines
...
| * * Re-name doctests.Barry Warsaw2013-08-252-2/+216
| | | | | | | | | | * Fix executable location now that we're not using buildout. * Fix enum repr.
| * Switch to virtualenv and nose2 instead of zc.buildout and zope.testing.Barry Warsaw2013-08-253-40/+62
|/
* * `bin/runner` command has been simplified and its command line optionsBarry Warsaw2013-06-171-24/+3
| | | | | | | | | | | | | | | | | | | | | | | | reduced. Now, only one `-r/--runner` option may be provided and the round-robin feature has been removed. * Fixed REST server crash on `reopen` command. Identification and test provided by Aurélien Bompard. (LP: #1184376) Also: * bin/runner now uses standard argparse instead of ScriptOptions. * The entire bin/runner machinery has bee reorganized and simplified. There * is no more Loop class. Signal setting is moved directly into the base Runner class and overrided in specific subclasses (e.g. RESTRunner which must cleanly shutdown its TCPServer). The runner exit status is now set directly on the Runner instance. * Fixed a few minor style issues. * In order to cleanly shutdown the RESTRunner's WSGI server, we must start a subthread which only watches for an Event and then calls the server's shutdown() method. It has to be this way because the WSGI server itself (due to interactions with SQLite), and the signal handlers (due to Python's signal handling semantics) must both run in the main thread. However, the shutdown() must be invoked from a subthread in order to prevent deadlock. * Refactor the RESTLayer to eliminate duplication of code.
* Bump copyright years.Barry Warsaw2013-01-017-7/+7
|
* * The default list style is renamed to `legacy-default` and a newBarry Warsaw2012-12-301-0/+1
| | | | | | | | `legacy-announce` style is added. This is similar to the `legacy-default` except set up for announce-only lists. Also, major refactoring of the default style into (hopefully) smaller composable units.
* * A user's password can be verified by POSTing to .../user/<id>/login. TheBarry Warsaw2012-12-261-1/+7
| | | | | | data must contain a single parameter `cleartext_password` and if this matches, a 204 (No Content) will be returned, otherwise a 403 (Forbidden) is returned. (LP: #1065447)
* * Deleting a user through the REST API also deletes all the user's linkedBarry Warsaw2012-11-051-1/+0
| | | | | | addresses and memberships. (LP: #1074374) Also: Clean up pyflakes warning by removing an obsolete __all__ entry.
* Merge Aurélien Bompard's branch to factor our archiver-specific configurationsBarry Warsaw2012-11-043-3/+10
|\ | | | | | | | | into their own configuration files. Reworked by Barry to use the new external configuration file support, and to make test suite succeed.
* | ConfigurationBarry Warsaw2012-11-042-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ------------- * `[passlib]path` configuration variable renamed to `[passlib]configuration`. * Postfix-specific configurations in the `[mta]` section are moved to a separate file, named by the `[mta]configuration` variable. * In the new `postfix.cfg` file, `postfix_map_cmd` is renamed to `postmap_command`. Also: * More Python 2.7-isms, use assertMultiLineEqual() directly. * Added external_configuration() and load_external() to mailman.config.config * ConfigLayer does a blanket set of [postfix]postmap_command so subtests generally won't have to.
* | * Python 2.7 is not required. Python 2.6 is no longer officially supported.Barry Warsaw2012-10-311-20/+4
|/ | | | | The code base is now also `python2.7 -3` clean, although there are still some warnings in 3rd party dependencies. LP: #1073506
* * Clarify the semantics of the noreply_address variable. It's the local-partBarry Warsaw2012-08-151-3/+3
| | | | | | | | of an email address. * Rectify an omission in the copyright assignees. * Of course, don't use PostgreSQL by default in the test suite.
* * The policy for archiving has now been collapsed into a single enum, calledBarry Warsaw2012-07-263-4/+34
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ArchivePolicy. This describes the three states of never archive, archive privately, and archive_publicly. (LP: #967238) Database -------- * Schema migrations (LP: #971013) - include_list_post_header -> allow_list_posts - news_prefix_subject_too -> nntp_prefix_subject_too - news_moderation -> newsgroup_moderation - archive and archive_private have been collapsed into archive_policy. - nntp_host has been removed. * The PostgreSQL port of the schema accidentally added a moderation_callback column to the mailinglist table. Since this is unused in Mailman, it was simply commented out of the base schema for PostgreSQL.
| * Working for SQLite:Barry Warsaw2012-07-251-3/+3
| | | | | | | | | | | | include_list_post_header -> allow_list_posts Also add a bunch more migration tests.
| * Fix resetting PostgreSQL databases, thus making the full test suite pass withBarry Warsaw2012-07-251-3/+3
| | | | | | | | them.
| * Refactor to better handling the difference between a testing database and aBarry Warsaw2012-07-253-51/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | production database. - Add an IDatabaseFactory interface with two named utility implementations. The initialization subsystem will either ask for the 'testing' or 'production' factory utility depending on whether we're in the test suite or not. The testing factory returns an IDatabase that can be _reset(). - initialize_2() now takes an optional `testing` argument, defaulting to False. The test ConfigLayer will pass in True. - Remove _reset() from the base database class. - The ModelMeta now adds a PRESERVE attribute to database classes. This defaults to False, meaning by default the test framework will reset the table. The Version table is preserved because it records the schema migrations. - Because of the above, we no longer need to support pre_reset() and post_reset() on migrations. Also, bin/mailman should allow the standard configuration file search algorithm to be used except when -C/--config is given.
| * One more refactoring.Barry Warsaw2012-07-251-3/+3
| |
| * Refactor once again for SQLite/PostgreSQL differences.Barry Warsaw2012-07-251-3/+3
| |
| * Checkpointing Postgres port of test suite.Barry Warsaw2012-07-231-3/+3
| | | | | | | | | | | | | | | | | | - Refactor load_schema() into a separate load_sql() method. - Add API for test suite to make a temporary database. - Add code to migrate the PostgreSQL database. - Comment out `moderation_callback` from the PostgreSQL SQL; this must have snuck in accidentally via the contributed port. - Refactor test_migrations.py
| * Get test suite completely working:Barry Warsaw2012-07-201-0/+47
| | | | | | | | | | | | | | - migrations.rst needs to handle new standard migration - Add ResetHelper() to refactor out common migration test cooperation. - Handle temporary database. - Fix some attribute names.
| * trunk mergeBarry Warsaw2012-07-204-5/+16
| |\ | |/ |/|
* | More consistency in the way post-configuration changes are processed. LessBarry Warsaw2012-07-021-2/+2
| | | | | | | | | | | | | | | | | | | | magic in the _post_process() method, more ConfigurationUpdatedEvents. More centralization of event initialization. Added property Configuration.language_configs. Instead of initializing events in initialize_2(), initialize them in initialize_1() and do it before the configuration is loaded.
* | * `passlib`_ is now used for all password hashing instead of flufl.password.Barry Warsaw2012-07-024-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default hash is `sha512_crypt`. * Events renamed and moved: * `mailman.chains.accept.AcceptNotification` * `mailman.chains.base.ChainNotification` * `mailman.chains.discard.DiscardNotification` * `mailman.chains.hold.HoldNotification` * `mailman.chains.owner.OwnerNotification` * `mailman.chains.reject.RejectNotification` changed to (respectively): * `mailman.interfaces.chains.AcceptEvent` * `mailman.interfaces.chains.ChainEvent` * `mailman.interfaces.chains.DiscardEvent` * `mailman.interfaces.chains.HoldEvent` * `mailman.interfaces.chains.AcceptOwnerEvent` * `mailman.interfaces.chains.RejectEvent` * A `ConfigurationUpdatedEvent` is triggered when the system-wide global configuration stack is pushed or popped. * With the switch to `passlib`_, `[passwords]password_scheme` has been removed. Instead use `[passwords]path` to specify where to find the `passlib.cfg` file. See the comments in `schema.cfg` for details.
* | Replace flufl.password with passlib, albeit with a wrapper.Barry Warsaw2012-06-271-1/+1
| |
| * trunk mergeBarry Warsaw2012-06-033-26/+28
| |\ | |/ |/|
* | General code cleanup.Barry Warsaw2012-04-251-4/+3
| | | | | | | | | | | | | | | | - Add explicit dependency on zope.event in setup.py. - Use Python 3 compatible syntax for specifying that a class implements an interface, i.e. the @implementer class decorator. - print_function futures. - Whitespace normalization.
* | - Modernize the helpers.py module by using print() functions.Barry Warsaw2012-04-221-16/+18
| | | | | | | | | | - Rewrite soem of the code to use the new transaction context manager, instead of explicitly accessing the config.db global.
* | - Modernize the layers.py module by using print().Barry Warsaw2012-04-221-6/+7
| | | | | | | | | | - Rewrite a small bit of code to use the transaction context manager instead of accessing config.db directly.
| * - Refactor the way databases are schema-migrated so that load_migrations()Barry Warsaw2012-04-081-0/+30
|/ | | | | | | | | | | | | | | can be tested separately. - Add an `until` argument to load_migrations() so that we can load only up to a given timestamp. - In load_migrations(), ignore files in which the `version` part of the file name is empty. - In migrations.rst, use the new, better way of ensuring post-test cleanup. - Add tests for partial upgrades. - LP: #971013 - schema migrations for beta 2. - LP: #967238 - IMailingList.archive + IMailingList.archive_private -> IMailingList.archive_policy, and add ArchivePolicy enum. - Move the `chdir` context manager to helpers.py and add `temporary_db` context manager.
* * Header check specifications in the `mailman.cfg` file have changed quiteBarry Warsaw2012-04-061-0/+2
| | | | | | | | | | | | | | | | | | | | bit. The previous `[spam.header.foo]` sections have been removed. Instead, there's a new `[antispam]` section that contains a `header_checks` variable. This variable takes multiple lines of `Header: regexp` values, one per line. There is also a new `jump_chain` variable which names the chain to jump to should any of the header checks (including the list-specific, and programmatically added ones) match. * Fixed a typo when returning the configuration file's header match checks. (LP: #953497) Also: - Remove an unused method. - Improve test coverage for mailman/app/bounces.py - 100% test coverage for mailman/chains/headers.py - Various other minor code cleanup. - Fixed the 'any' rule, which was checking a bogus metadata dictionary key.
* - Improve the NNTP doctest.Barry Warsaw2012-04-021-0/+20
| | | | | - Add a `cleanups` global to doctests. This can be used to register functions which will get called automatically at doctest tearDown time.
* - More tests of mailman.runners.nntp.prepare_message(), this time of theBarry Warsaw2012-04-011-0/+41
| | | | | | | | | header removal and de-duplication algorithms. - Improve the robustness of the de-duplication code. - Add a very nice helper called `configuration` which can be used either as a decorator or context manager to temporarily set values in a configuration section. No more need to manage pushes/pops. More code needs to be converted to use this style.
* * The `news` runner and queue has been renamed to the more accurate `nntp`.Barry Warsaw2012-03-311-1/+1
| | | | Beta testers can can safely remove `$var_dir/queue/news`.
* Verp all messages to the -owners. Add a test to prove that email to -ownersBarry Warsaw2012-03-231-0/+8
| | | | now works as expected!
* - Move some normal recipient tests to unittests.Barry Warsaw2012-03-231-0/+3
| | | | | | | | - Add unittests for owner recipients. There does eventually need to be some documentation about owner recipients. - Implement owner recipients handler. This includes moderators and owners (i.e. all the non-disabled the list administrators). - Changed the [mailman]site_owner setting in testing.cfg to noreply@example.com
* Several fixes and cleanups, ostensibly to fix Python 2.6 support.Barry Warsaw2012-03-221-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | - email.iterators.body_line_iterator() cannot handle unicodes in Python 2.6, because it uses cStringIO.StringIO under the covers, and *that* can't handle unicode. This works fine in Python 2.7, so I override this for the tests only under 2.6 (the code itself isn't affected). - AddressError needs to str() its IAddress attribute explicitly in the __str__() method, otherwise under Python 2.6, you'll get unprintable reprs in the doctests. Again, this works correctly in 2.7, but EIBTI, so it can't hurt either way. - EmailError: a new exception, not related to AddressError. The reason for this it to conform to current nomenclature: "address" means an IAddress while "email" means a text email address. So InvalidEmailAddressError now derives from EmailError instead of AddressError because it gets passed a text email address, and because that is invalid, it never gets turned into an IAddress. The __str__() of this new base exception class does some tricky encoding to keep it compatible between Python 2.6 and 2.7. - UnverifiedAddressError derives from AddressError instead of the more generic MailmanError. - A few random code cleanups are included.
* Merge the Pipermail eradication branch. The scrubber is also removed.Barry Warsaw2012-03-171-4/+0
|\ | | | | | | | | | | | | | | | | | | | | | | * Configuration variable `[mailman]filtered_messages_are_preservable` controls whether messages which have their top-level `Content-Type` filtered out can be preserved in the `bad` queue by list owners. * Configuration section `[scrubber]` removed, as is the scrubber handler. This handler was essentially incompatible with Mailman 3 since it required coordination with Pipermail to store attachments on disk. * Schema additions: - mailinglist.filter_action
| * Eradicate Pipermail. Everything but the scrubber test works. That will takeBarry Warsaw2012-03-151-4/+0
| | | | | | | | some new APIs I suspect.
* | Schema change. After discussion at Pycon, we decided to change "real_name" toBarry Warsaw2012-03-154-8/+8
|/ | | | | | | | | | | "display_name" across the board. * `IMailingList.real_name` -> `IMailingList.display_name` * `IUser.real_name` -> `IUser.display_name` * `IAddress.real_name` -> `IAddress.display_name` * Schema changes: - real_name -> display_name (mailinglist, user, address)
* * The LMTP server now requires that the incoming message have a `Message-ID`,Barry Warsaw2012-03-132-3/+37
| | | | | | | | | | | otherwise it rejects the message with a 550 error. Also, the LMTP server adds the `X-Message-ID-Hash` header automatically. The `inject` cli command will also add the `X-Message-ID-Hash` header, but it will craft a `Message-ID` header first if one is missing from the injected text. Also, `inject` will always set the correct value for the `original_size` attribute on the message object, instead of trusting a possibly incorrect value if it's already set. The individual `IArchiver` implementations no longer set the `X-Message-ID-Hash` header.
* * The experimental `maildir` runner is removed. Use LMTP.Barry Warsaw2012-03-121-3/+0
|
* * The `join` email command no longer accepts an `address=` argument. ItsBarry Warsaw2012-02-291-1/+1
| | | | | | | | | `digest=` argument now accepts the following values: `no` (for regular delivery), `mime`, or `plain`. Also: - Fix get_queue_messages() to properly sort on the string representation of a header, since it could be a Header instance.
* copybumpBarry Warsaw2012-01-016-6/+6
|
* * Stop adding the X-BeenThere header.Barry Warsaw2011-11-061-1/+6
| | | | | | | * Separate out the RFC 2369 header adding handler. * Dynamically calculate the `List-Id` header instead of storing it in the database. This means it cannot be changed. * Be sure to clean out any digest .mmdf files when the world is reset.
* * Implement the style manager as a utility instead of an attribute hangingBarry Warsaw2011-10-241-1/+2
| | | | | | off the `mailman.config.config` object. * Fixed bogus use of `bounce_processing` attribute (should have been `process_bounces`, with thanks to Vincent Fretin. (LP: #876774)
* PostgreSQL support contributed by Stephen A. Goss, with refactoring and testBarry Warsaw2011-10-231-0/+5
|\ | | | | | | suite compliance by Barry. (LP: #860159)
| * - Ensure that class removal is deterministic.Barry Warsaw2011-10-221-0/+4
|/ | | | | | - Comment out a few more foreign key constraints since they break the tests. - Enable the PostgreSQLDatabase for testing (this one should not be committed on trunk.
* Complete bug 827036 work.Barry Warsaw2011-08-171-0/+1
| | | | | | | | | | | * Add ListCreatingEvent and ListDeletingEvent. These are sent before the operation actually occurs, whereas the previously added ListCreatedEvent and ListDeletedEvent are sent after the operation. Specifically, this is necessary because request database deletion requires the IMailingList object, which is only available before the list is deleted. * Add a handler to clear out the requests database for a mailing list, when the mailing list is about to be deleted.
* Fixed two typos.Barry Warsaw2011-06-111-2/+3
| | | | | * Use a list comprehension to get a proper list of addresses. * config.devmode.testing must be converted to a boolean.
* Refactor MTA alias creation.Barry Warsaw2011-06-101-2/+2
| | | | | | | | | | | | | * Create an IMailTransportAgentAliases utility that contains all the logic for generating all the aliases for a mailing list, both the fully-qualified ones and the local-part ones. * Add -f and -s options to `bin/mailman aliases` to facilitate outputing the aliases in other formats than the configured one, and for printing out a simple list of the aliases. * IMailTransportAgentAliases -> IMailTransportAgentLifecycle; also add a new definition for IMailTransportAgentAliases
* Major terminology shift:Barry Warsaw2011-06-013-24/+22
| | | | | | | | | | | | | | | | | * Queue runners are now called just 'Runners' since several of them don't manage queue directories. * Ban the term 'qrunner' too. * The master queue runner watcher should now just be called the 'master' or the 'master runner'. * bin/qrunner -> bin/runner * mailman.qrunner log file -> mailman.runner * master-qrunner.lck -> master.lck * master-qrunner.pid -> master.pid Also: * Remove some obsolete files * Begin the .txt -> .rst renaming