summaryrefslogtreecommitdiff
path: root/src/mailman/rest/tests/test_moderation.py
Commit message (Collapse)AuthorAgeFilesLines
* Squashed commit of the following:HEADmasterBarry Warsaw2017-08-291-0/+19
| | | | | | | | | | | | | | | | | commit 3c6500c2292869f94667520f16c8d6c6f1d2c530 Author: Barry Warsaw <barry@python.org> Date: Tue Aug 29 22:51:18 2017 -0400 Close #383 Messages with badly encoded ``Subject`` headers no longer crash the message moderation REST API. commit f6040ec139bcccd48cfa9acc734cd528a8ede35c Author: Aurélien Bompard <aurelien@bompard.org> Date: Thu Jul 27 00:52:05 2017 +0200 Fix #383: email encoding errors can crash the REST API
* Remove the dependency on httplib2.Barry Warsaw2017-02-061-53/+52
| | | | Closes #42
* Bump copyright years.Barry Warsaw2017-01-041-1/+1
|
* Fix QA.Barry Warsaw2016-11-251-1/+0
|
* Add NEWS and a little bit of cleanup.Barry Warsaw2016-11-251-5/+5
|
* Rename test email and use resource filename instead of __file__.Abhilash Raj2016-11-251-4/+6
|
* Return 'defective message' for a bad held messageAbhilash Raj2016-11-251-0/+19
| | | | | If a message can't be parsed by Python due to bad structure, don't raise an error but return a generic 'this message is defective' string instead.
* Simplify the implementation.Barry Warsaw2016-10-171-3/+2
| | | | | | | | | | | | | | | | | | | | | | This merges the SubscriptionManager and UnsubscriptionManager into a single SubscriptionManager implementation that handles both register() and unregister(). This allows us to use direct class-based adaptation instead of the more clunky getAdapter() API. We can also eliminate the funky _get_workflow() implementation detail. This has a couple of side-effects. .confirm() must lookup the token in the pendings database and pull out the pending type, dispatching to the proper class depending on the type, or raising a LookupError if the token is None or there is no pendable associated with the given token. This feels like an acceptable trade-off. However, this *also* means that IWorkflowStateManager must lose its 'name' argument in its methods. That's because we won't actually know the name until its too late. Honestly, the name wasn't providing much value anyway (it was always the subclass's name), so losing that seems fine too. The complication here is that the name was a primary key in the 'workflowstate' table, so we need to add its removal in the database migration.
* flake8 fixes.Barry Warsaw2016-10-161-1/+1
|
* IWorkflowManager -> ISubscriptionManagerBarry Warsaw2016-09-011-2/+2
|
* CheckpointingBarry Warsaw2016-09-011-1/+1
|
* Intermediate CommitAbhilash Raj2016-09-011-3/+4
|
* Clean up the rest directory.Barry Warsaw2016-03-251-8/+0
|
* Handle AlreadySubscribedError in REST.Barry Warsaw2016-02-151-0/+15
| | | | | | | | When approving a subscription request via the REST API, for a user who is already a member, return an HTTP 409 Conflict code instead of the previous server traceback (and resulting HTTP 500 code). Closes #193
* Prevent moderation of messages held for a different list.Barry Warsaw2016-02-071-0/+23
| | | | Closes: #161
* Add a set_preferred() helper.Barry Warsaw2016-02-061-5/+3
| | | | | This refactors the setting of a user's preferred address to the first in their list of linked addresses.
* Boost coverage.Barry Warsaw2016-01-091-3/+48
|
* Support SQL queries for CollectionMixin._get_collectionAurélien Bompard2016-01-061-0/+10
|
* More coverage.Barry Warsaw2016-01-041-0/+22
|
* Happy New Year.Barry Warsaw2016-01-021-1/+1
|
* _resource_as_dict() may not return None.Barry Warsaw2015-12-121-1/+1
| | | | Add some assertions to prove this is always the case.
* Branch his ready.Barry Warsaw2015-04-171-5/+43
|
* Check pointing new subscription moderation REST API.Barry Warsaw2015-04-171-44/+87
|
* Checkpointing.Barry Warsaw2015-04-161-49/+170
|
* * Refactor add_member() so that it uses a RequestRecord namedtuple.Barry Warsaw2015-03-211-4/+7
| | | | | | * RequestRecord contains no password key so these are not part of the held requests database any more. * Pending record contains `email` now instead of `address`.
* We don't need the 'six' package any more.Barry Warsaw2015-01-041-1/+1
|
* Bump copyright years.Barry Warsaw2015-01-041-1/+1
|
* Remove huge amounts of now unnecessary file boilerplate.Barry Warsaw2014-12-221-3/+1
|
* All the REST tests pass.Barry Warsaw2014-12-151-0/+13
|
* Checkpointing more fixes.Barry Warsaw2014-12-111-2/+4
|
* Checkpointing.Barry Warsaw2014-11-301-2/+1
| | | | | | | | | | 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.
* Bump copyright years.Barry Warsaw2014-01-011-1/+1
|
* Bump copyright years.Barry Warsaw2013-01-011-1/+1
|
* Flesh out a few more tests.Barry Warsaw2012-12-171-2/+34
|
* * Simplify moderator.rst and requests.rst so they serve a better purpose asBarry Warsaw2012-12-171-1/+1
| | | | | | | | | | 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.
* * Python 2.7 is not required. Python 2.6 is no longer officially supported.Barry Warsaw2012-10-311-23/+9
| | | | | The code base is now also `python2.7 -3` clean, although there are still some warnings in 3rd party dependencies. LP: #1073506
* - Remove an obsolete script.Barry Warsaw2012-04-221-2/+3
| | | | - Fix up one more use of config.db global.
* * Held messages can now be moderated through the REST API. Mailing listBarry Warsaw2012-01-301-0/+107
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.