summaryrefslogtreecommitdiff
path: root/src/mailman/app/tests/test_subscriptions.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Bump copyright years.Barry Warsaw2017-01-041-1/+1
|
* Fix flake8 errors.Mark Sapiro2016-12-041-1/+2
|
* Fix tests for test-owner instead of moderator's address.Mark Sapiro2016-12-041-1/+1
|
* Run the workflows at the end of the tests to clean things upAurélien Bompard2016-11-211-0/+5
|
* Handle a missing user when a workflow is restored.Aurélien Bompard2016-11-211-0/+37
| | | | | | Between the creation of a subscription workflow and its approval, the user may have been merged with another user. In this case, use the associated address to find the new user.
* Fix a flake8 error.Barry Warsaw2016-11-131-1/+1
|
* Closes: #68Barry Warsaw2016-11-131-4/+9
| | | | | Messages sent to the list's moderators now include the actual recipient addresses. Given by Tom Briles.
* Issue 68: send messages to list moderators when tomoderators=TrueTom Briles2016-10-311-1/+6
|
* 99% test coverage.Barry Warsaw2016-10-211-0/+27
| | | | | | | | | Also: * Ignore coverage in the testing submodule. * Remove some unreachable code. * Spelling. * Fix a bug in run_thru().
* Simplify the implementation.Barry Warsaw2016-10-171-9/+0
| | | | | | | | | | | | | | | | | | | | | | 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.
* Split registration (subscription) and unsubscription:Barry Warsaw2016-09-131-2/+2
| | | | | | | | * events * notices * handlers Also, be sure to do only one `leave` command per email.
* Fix more tests.Barry Warsaw2016-09-111-2/+2
|
* Intermediate CommitAbhilash Raj2016-09-011-2/+2
|
* New template system. Closes #249Barry Warsaw2016-07-161-1/+2
| | | | | The new template system is introduced for API 3.1. See ``src/mailman/rest/docs/templates.rst`` for details.
* Use contextlib.suppress() where appropriate.Barry Warsaw2016-04-301-3/+2
|
* Import order flake8 plugin.Barry Warsaw2016-03-271-2/+2
| | | | Fix lots of import order errors discovered by the new plugin.
* First massive round of cleanups.Barry Warsaw2016-03-231-26/+15
| | | | | | | | * Get rid of explicit __all__ settings and use the @public decorator. * Get rid of ^L's * Use expected_count argument for get_queue_messages() * Various code modernizations. * Other minor changes to make flake8 happy.
* Add a set_preferred() helper.Barry Warsaw2016-02-061-7/+4
| | | | | This refactors the setting of a user's preferred address to the first in their list of linked addresses.
* Boost coverage.Barry Warsaw2016-01-081-0/+20
|
* Refactor some tests and documentation.Barry Warsaw2016-01-071-202/+2
| | | | | | Increase coverage. Add ISubscriptionService.find_member() as per discussion.
* Additional refactoring to use the QuerySequence wrapper, so that we can stillBarry Warsaw2016-01-061-8/+8
| | | | | | use len() and slicing on SQLAlchemy query results. We also don't need to list()-ify the results in the tests. This isn't perfect, but at least it doesn't introduce yet another layer violation.
* Make the members request pageableAurélien Bompard2016-01-061-8/+8
|
* Happy New Year.Barry Warsaw2016-01-021-1/+1
|
* Refactor the SubscriptionService.find_members method to be pure SQLAurélien Bompard2015-12-111-2/+202
| | | | | | | | | | Additional cleanups by Barry. Fix the SubscriptionService.find_members SQL query on PostgreSQL. Assert that an unsupported use case is actually unsupported. Various little clean ups.
* Merge branch 'issue-75' into 'release-3.0'Barry Warsaw2015-06-021-0/+2
| | | | | | Issue #75 - Confirmation messages should not be `Precedence: bulk`. See merge request !15
* Check pointing new subscription moderation REST API.Barry Warsaw2015-04-171-2/+3
|
* Checkpointing.Barry Warsaw2015-04-161-0/+16
|
* Clean up some templates; given by raj-abhilash1Barry Warsaw2015-04-161-12/+6
|\
| * fix tests for previous commitAbhilash Raj2015-04-161-1/+1
| |
* | Plumb the subscription policy through the REST API.Barry Warsaw2015-04-151-1/+31
| |
* | Give the SubscriptionWorkflow a member attribute which gets set to the memberBarry Warsaw2015-04-151-39/+20
| | | | | | | | | | | | | | | | once their subscription is completed. Remove some dead tests. Update an interface.
* | The SubscriptionWorkflow and Registar classes now have both a token and aBarry Warsaw2015-04-151-1/+40
|/ | | | | | | | | | | | "token owner". The latter describes who owns the token --i.e. which phase of the workflow is being waited on. It can either be no one, the subscriber, or the moderator. Tokens and token owners are properly initialized and reset when the workflow is completed, so we always know which step of the process is being waited on. Also, remove ISubscriptionService.join() since this will now be handled by the IRegistrar adapter.
* Prevent replay attacks with the confirmation token.Barry Warsaw2015-04-151-0/+41
|
* Remove unused import.Barry Warsaw2015-04-141-1/+0
|
* Full test suite passes.Barry Warsaw2015-04-141-3/+3
| | | | | | | | | | | | | * Make sure Registrar.discard() removces any workflow state manager state associated with the token, and that this is flushed to SA. * Adjust the email commands to the new IRegistrar API. * Update the IRegistrar interface. * Add IWorkflowStateManager.discard() and make `count` an attribute/property. * Mark two tests as expected failures due to LP: #1444184.
* The SubscriptionWorkflow class doesn't need to include the expiry date in itsBarry Warsaw2015-04-131-0/+28
| | | | | | | | | pendable data since that gets added automatically by the IPendings utility. After the user is subscribed, clean up the saved workflows and reset the token to None. Give the SubscriptionWorkflow a name property for convenience.
* SubscriptionPolicy is largely done, modulo bugs, and the unknown-unknown ofBarry Warsaw2015-04-131-61/+78
| | | | | | | | | | | | | course. This commit contains test failures because the next step is to hook everything up. Changes here include: * confirm.txt removes the URL since we can't know that. * Changes to the ConfirmationNeededEvent * Create the Pendable early in the workflow. * Clean up test. * Update IRegistrar docstring.
* Subscription workflows now support bans.Barry Warsaw2015-04-131-1/+17
|
* Subsume hold_subscription() functionality into the subscription workflow.Barry Warsaw2015-04-131-0/+60
| | | | | Specifically, log a message and send a notification to the list owners when a subscription is held and the list is so configured.
* Handle save/restore of the subscription workflow.Barry Warsaw2015-04-131-2/+29
| | | | | | | | | | To handle the case of restoring a saved workflow, allow the subscriber to be None in the constructor, but assert that it is not None after the first workflow step. Add setters/getters for handling save/restore. In the base workflow interface, rename key to token.
* Subscription workflow checkpointing.Barry Warsaw2015-04-091-11/+242
| | | | | | | | | | * TO DO: - hook up sending of confirmation - processing confirmations and continuing workflow - get tokens for saving workflows - integrate with RequestRecord - integrate with hold_subscription - after getting moderator approval, continue workflow
* Check pointingBarry Warsaw2015-04-061-0/+15
|
* * Refactor test_workflow into a separate module.Barry Warsaw2015-03-291-45/+2
| | | | | | | | | * save_state() -> save() * restore_state() -> restore() * Add push() as the public API for pushing new state on the deque. * Uppercase class attributes. * Add logging on exception. * Minor style fixes.
* Test when confirmations are requiredAurélien Bompard2015-03-271-1/+20
|
* Write and move tests for the bare Workflow classAurélien Bompard2015-03-271-32/+42
|
* Workflow: allow saving and restoring with an empty queueAurélien Bompard2015-03-271-0/+15
|
* Save and restore attributesAurélien Bompard2015-03-261-1/+4
|
* Save the workflow state in the databaseAurélien Bompard2015-03-251-0/+15
|
* SubscriptionWorkflow: add a test for moderated listsAurélien Bompard2015-03-251-0/+27
|
* Resurrect Barry's subpolicy branch (lp:~barry/mailman/subpolicy)Aurélien Bompard2015-03-201-1/+34
|