summaryrefslogtreecommitdiff
path: root/src/mailman/app/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* Checkpointing.Barry Warsaw2014-11-301-10/+10
| | | | | | | | | | By using `six` I think I have most of the imports squared away. There's probably still uses of `unicode` built-ins that need fixing. The idea is to first get the test suite running (which it doesn't yet), and then to fix tests. There's a bug in lazr.config which requires us to patch it for now.
* Trunk mergeBarry Warsaw2014-04-149-28/+220
|\
| * * Module coding style consistency.Barry Warsaw2014-03-021-9/+32
| | | | | | | | | | | | | | * handle_SubscriptionEvent(): We're always guaranteed to get a language from a member, since lookup falls back ultimately to the system preferences. So this method can be simplified. * Bump up code coverage for several modules.
| * - Clean up and simplify remove_list()Barry Warsaw2014-03-021-1/+13
| | | | | | | | - Boost test coverage of lifecycle.py to 100%
| * Several internal improvements:Barry Warsaw2014-01-063-10/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * New events: - ConfirmationNeededEvent is triggered when a pendable requiring confirmation is created. This allows us to define an event handler for this event which sends the user notification. - SubscriptionEvent is triggered when a member is added to a mailing list. This lets us define an event handler which sends the welcome message. * send_welcome_message() now takes a member parameter instead of an address, which lets us directly access the member's delivery mode and user display name (if the member has a user, which it might not in some cases). * Use the list id in the pendable record instead of the list name for robustness (the latter can change but the former is permanent). * Test more registration conditions. * In the bin/runner command line switch handling, default `verbose` to None instead of False. This makes it work better with nose's -E switch (log to stderr). * In call_api(), if a POST, PUT, or PATCH method is used and data is None, encode the empty dictionary; seems like the behavior of urlencode() has changed, so this is safer. * Fix style and pyflakes warnings.
| * Bump copyright years.Barry Warsaw2014-01-018-8/+8
| |
* | Aurélien Bompard's import-from-2.1 branch, with cleanup and fixes.Barry Warsaw2014-04-141-0/+11
|\ \ | |/ |/|
| * Text templates should be in UTF-8Aurélien Bompard2013-10-211-0/+11
|/
* Bump copyright years.Barry Warsaw2013-01-018-8/+8
|
* LP: #975692 phase 1Barry Warsaw2012-12-282-4/+50
| | | | | | | | | | | | | | | | | * Rework list style management. No more style priorities or matching.. Now, you name a style explicitly to apply and that's it. * create_list() now takes a `style` argument. * config file now names both a default style to use, and a set of paths to scan for IStyle instances. (This could be a model for other plugins.) * added IMailingList.style_name to record the last style applied, but this is going to be removed in subsequent revisions. Also: * Move find_components() and scan_module() from app/finder.py to utilities/modules.py * Cleaned up lifecycle.rst for better documentation. Some tests moved to test_lifecycle.py. * Remove some unnecessary test tearDown() code.
* * Simplify moderator.rst and requests.rst so they serve a better purpose asBarry Warsaw2012-12-171-6/+40
| | | | | | | | | | documentation. Move non-documentation tests into a separate unittest file. * Separate out the doctests for IRequest from the doctests for app/moderator.py and place the latter in a separate file. * Fix typo in app/membership.py (s/send_goodbye_msg/send_goodbye_message), but LP: #1091321 tracks more needed fixes in this area.
* ConfigurationBarry Warsaw2012-11-044-17/+11
| | | | | | | | | | | | | | | ------------- * `[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-313-47/+20
| | | | | The code base is now also `python2.7 -3` clean, although there are still some warnings in 3rd party dependencies. LP: #1073506
* DatabaseBarry Warsaw2012-10-161-14/+14
| | | | | | | | | | | | -------- * The `ban` table now uses list-ids to cross-reference the mailing list, since these cannot change even if the mailing list is moved or renamed. Interfaces ---------- * The `IBanManager` is no longer a global utility. Instead, you adapt an `IMailingList` to an `IBanManager` to manage the bans for a specific mailing list. To manage the global bans, adapt ``None``.
* * The link between members and the mailing lists they are subscribed to, isBarry Warsaw2012-09-042-6/+6
| | | | | | | | | | | | | | | now via the RFC 2369 `list_id` instead of the fqdn listname (i.e. posting address). This is because while the posting address can change if the mailing list is moved to a new server, the list id is fixed. (LP: #1024509) + IListManager.get_by_list_id() added. + IListManager.list_ids added. + IMailingList.list_id added. + Several internal APIs that accepted fqdn list names now require list ids, e.g. ISubscriptionService.join() and .find_members(). + IMember.list_id attribute added; .mailing_list is now an alias that retrieves and returns the IMailingList. - list_id added (LP: #1024509)
* * Non-unicode values in msgdata broke pending requests. (LP: #1031391)Barry Warsaw2012-08-171-0/+12
|
* * `passlib`_ is now used for all password hashing instead of flufl.password.Barry Warsaw2012-07-021-18/+1
| | | | | | | | | | | | | | | | | | | | | | | 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-3/+4
|
* Whitespace normalization.Barry Warsaw2012-04-061-2/+0
|
* * Header check specifications in the `mailman.cfg` file have changed quiteBarry Warsaw2012-04-061-19/+46
| | | | | | | | | | | | | | | | | | | | 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.
* Several fixes and cleanups, ostensibly to fix Python 2.6 support.Barry Warsaw2012-03-221-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | - 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.
* Schema change. After discussion at Pycon, we decided to change "real_name" toBarry Warsaw2012-03-151-1/+1
| | | | | | | | | | | "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)
* * Subscription disabled probe warning notification messages are now sentBarry Warsaw2012-03-141-4/+15
| | | | without a `Precedence:` header. Given by Mark Sapiro. (LP: #808821)
* * The LMTP server now requires that the incoming message have a `Message-ID`,Barry Warsaw2012-03-131-12/+65
| | | | | | | | | | | 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.
* * Fix `test_moderation` for timezones East of UTC+0000, given by blacktav.Barry Warsaw2012-03-121-3/+4
| | | | (LP: #890675)
* Consistent use of assertMultiLineEqual().Barry Warsaw2012-03-064-21/+14
|
* Fix welcome_message_uri to do the placeholder interpolations guaranteed in theBarry Warsaw2012-03-041-0/+27
| | | | | | | | IMailingList documentation. Also: * `ILanguageManager.add()` returns the `ILanguage` object just created.
* - Test welcome message notifications.Barry Warsaw2012-03-041-0/+101
| | | | | - welcome.txt is no longer inserted into subscribeack.txt. This latter is renamed to welcome.txt as the default welcome message.
* * Support downloading templates by URI, including mailman:// URIs. This isBarry Warsaw2012-03-031-0/+146
| | | | | | | | | | | | | used in welcome and goodbye messages, and supports both language and mailing list specifications. E.g. mailman:///test@example.com/it/welc.txt * Schema changes: - welcome_msg -> welcome_message_uri - goodbye_msg -> goodbye_message_uri - send_welcome_msg -> send_welcome_message - send_goodbye_msg -> send_goodbye_message * New `ITemplateLoader` utility.
* * Major redesign of the template search system, fixing LP: #788309. $var_dirBarry Warsaw2012-03-031-10/+14
| | | | | | is now used when search for all template overrides, site, domain, or mailing list. The in-tree English templates are used only as a last fallback.
* * Held messages can now be moderated through the REST API. Mailing listBarry Warsaw2012-01-301-0/+14
| | | | | | | | | | | | | | | resources now accept a `held` path component. GETing this returns all held messages for the mailing list. POSTing to a specific request id under this url can dispose of the message using `Action` enums. * `IRequests` interface is removed. Now just use adaptation from `IListRequests` directly (which takes an `IMailingList` object). * `handle_message()` now allows for `Action.hold` which is synonymous with `Action.defer` (since the message is already being held). * `IListRequests.get_request()` now takes an optional `request_type` argument to narrow the search for the given request. - also, print_function is now a standard __future__ import. The template has been updated, but add this to modules as you edit them.
* copybumpBarry Warsaw2012-01-015-5/+5
|
* Remove extraneous `test_suite()` functions. zope.testrunner willBarry Warsaw2011-10-305-46/+0
| | | | | | | | | automatically do the right thing in most cases. Keep test_suite() in test_documentation.py since these dynamically set up docs tests properly. Refactor test_passwords.py so that base class tests aren't bogusly run. Also, remove test_membership.py which was essentially disabled because it was testing the MM2 membership API.
* * Rewrote a test for compatibility between Python 2.6 and 2.7. (LP: #833208)Barry Warsaw2011-09-071-24/+15
|
* * User and Member ids are now proper UUIDs. The UUIDs are pended as unicodes,Barry Warsaw2011-08-303-2/+129
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and exposed to the REST API as their integer equivalents. They are stored in the database using Storm's UUID type. - ISubscriptionService.get_member() now takes a UUID - IUserManager.get_user_by_id() now takes a UUID * Moderators and owners can be added via REST (LP: #834130). Given by Stephen A. Goss. - add_member() grows a `role` parameter. - ISubscriptionService.join() grows a `role` parameter. * InvalidEmailAddressError no longer repr()'s its value. * `address` -> `email` for consistency - delete_member() - ISubscriptionService.leave() * Fixed typo in app/subscriptions.py __all__ * AlreadySubscribedError: attributes are now public. * More .txt -> .rst renames.
| * LP: #834130 add moderators and owners through REST API w/testsStephen A. Goss2011-08-251-1/+13
|/
* * Local timezone in X-Mailman-Approved-At caused test failure. (LP: #832404)Barry Warsaw2011-08-231-4/+12
|
* * Moderating a message with Action.accept now sends the message. (LP: #827697)Barry Warsaw2011-08-221-0/+106
| | | | | | | | | | | Also: * Use utilities.datetime.now() so that moderation related dates are predictable during the test suite. * When a message is accepted, drop it in the pipeline queue. The above bug was caused by the message going in the incoming queue, and then being re-moderated. * Expose mailman.bin.master.Loop in __all__. * Add some helpful debug logging.
* * Move inject.py to mailman.app package.Barry Warsaw2011-06-151-0/+219
| | | | | * Expose **kws to inject_text() * Add tests.
* * bounce_unrecognized_goes_to_list_owner -> forward_unrecognized_bounces_to Barry Warsaw2011-05-251-2/+137
| | | | | | | | | | | | * Add an additional option for unrecognized bounce disposition: send it to the site administrators. * Move maybe_forward() from src/mailman/queue/bounce.py to src/mailman/app/bounces.py, refactor and add tests. * Add a LogFileMark class to help with tests that want to check the output to a log file. * OwnerNotification gets a better signature. Instead of tomoderators, the last argument is a roster to send the notification to. If roster is None, then the notification goes to the site administrators.
* Implement and test the extraction of the bouncing email address when a probeBarry Warsaw2011-05-091-2/+26
| | | | message bounces. This completes the refactoring of probes for MM3.
* Add non-English tests of the probe message.Barry Warsaw2011-05-081-1/+71
|
* Merge bounces branch (still incomplete, but tests pass).Barry Warsaw2011-05-071-13/+127
|\
| * checkpointingBarry Warsaw2011-05-061-1/+6
| |
| * * Fix setup.py version regexp.Barry Warsaw2011-05-031-13/+36
|/ | | | | | * Move get_verp() to class-based for easy overridding. Hook up StandardVERP but not yet ProbeVERP. * Use uuid.uuid4() to get unique id.
* Start the enablement of bounce detection.Barry Warsaw2011-05-011-0/+166
| | | | | | | | | | * Move VERP header extraction to mailman.app.bounces, and ports the implementation to the get_verp() function. * Restore the [mta] verp_regexp value which got lost along the way. * Move mailman.email.utils to mailman.utilities.email and add a test for split_email() * Move specialized_message_from_string() from test_documentation to mailman.testing.helpers.
* add_member()Barry Warsaw2011-04-081-0/+28
| | | | | | | | | | | | - As the most common interface for adding new members (and users), adapt the password storing bit to storing only encrypted passwords in the database. schema.cfg: - Remove the creator_pw_file and site_pw_file as they are obsolete. - Add password_schema key for defining the default password encryption scheme. mailman.sql, user.py: - Store the password as a binary blob instead of as unicode text.
* Eliminate Utils.get_pattern() and in the process, completely revampBarry Warsaw2011-02-251-1/+56
| | | | | | | | | subscription bans so as not to have to rely on BLOBS or pickles in the database. Also, be sure to include .rst files in both doctests and in the packaged tarballs. With the now awesome reST mode for Emacs, I plan to rename all .txt doctest files to .rst.
* Fixed a typo in add_member() which prevented subscribing an email address thatBarry Warsaw2011-01-312-0/+76
was already linked to a user. Found by Florian Fuchs who also provided the fix, though I implemented the test differently. LP: #710182 Also, refactor the "reset the world" functionality ConfigLayer.testTearDown() so that it could be used by other test code.