summaryrefslogtreecommitdiff
path: root/src/mailman/rest/tests/test_membership.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix two problems and close #260Barry Warsaw2017-04-221-0/+15
|
* Remove the dependency on httplib2.Barry Warsaw2017-02-061-65/+66
| | | | Closes #42
* Bump copyright years.Barry Warsaw2017-01-041-1/+1
|
* Simplify the implementation.Barry Warsaw2016-10-171-5/+3
| | | | | | | | | | | | | | | | | | | | | | 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.
* IWorkflowManager -> ISubscriptionManagerBarry Warsaw2016-09-011-4/+5
|
* CheckpointingBarry Warsaw2016-09-011-1/+1
|
* Intermediate CommitAbhilash Raj2016-09-011-4/+4
|
* Import order flake8 plugin.Barry Warsaw2016-03-271-1/+1
| | | | Fix lots of import order errors discovered by the new plugin.
* Clean up the rest directory.Barry Warsaw2016-03-251-12/+2
|
* Closes #199Barry Warsaw2016-03-221-0/+49
| | | | | New subscription requests are rejected if there is already one pending. With thanks to Anirudh Dahiya. (Closes #199)
* Fix #198 - duplicate owner subscription errorBarry Warsaw2016-03-051-0/+16
| | | | | | Trying to subscribe an address as a list owner (or moderator or nonmember) which is already subscribed with that role produces a server error.
* Add a set_preferred() helper.Barry Warsaw2016-02-061-12/+6
| | | | | This refactors the setting of a user's preferred address to the first in their list of linked addresses.
* Also add a test for the global ban listAurélien Bompard2016-01-201-0/+12
|
* Give a meaningful message when a banned member tries to joinAurélien Bompard2016-01-201-0/+13
|
* Use common idiom for converting the UUID.Barry Warsaw2016-01-131-4/+4
| | | | Wrap lines.
* Fix getting a list member through the 3.1 APIAurélien Bompard2016-01-131-0/+18
|
* Boost coverage.Barry Warsaw2016-01-081-0/+50
|
* Happy New Year.Barry Warsaw2016-01-021-1/+1
|
* Cleanups, corner case fixes, and coverage.Barry Warsaw2015-12-311-1/+27
|
* Major push for completing issue #121. Now in API 3.1, all UUIDs must be theBarry Warsaw2015-12-301-1/+150
| | | | | | | | | hex representations of a UUID, not the int representation. Also: * Some general code cleanup. * Fix issue 185 (REST server crash when subscribing a user without a preferred address).
* Allow a Member's moderation_action to be changed by the REST API.Aurélien Bompard2015-12-081-0/+13
| | | | Cleanups by Barry. Closes !67
* Plumb the subscription policy through the REST API.Barry Warsaw2015-04-151-0/+12
|
* LP: #1425359: Elaborate on how email addresses with mixed case can subscribeBarry Warsaw2015-03-131-6/+38
|\ | | | | | | to a mailing list.
| * Fixed the issue #1425359 and wrote corresponding tests.black-perl ankprashar@gmail.com2015-03-041-0/+9
|/
* 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/+0
|
* Two more REST tests passing.Barry Warsaw2014-12-151-5/+5
|
* Checkpointing.Barry Warsaw2014-11-301-3/+2
| | | | | | | | | | 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.
* Complete the conversion from restish to falcon, modulo a clean up pass. AllBarry Warsaw2014-08-141-3/+0
| | | | REST tests pass. This requires an as yet unmerged internal change to falcon.
* * Fixed a crash in the REST server when searching for nonmembers viaBarry Warsaw2014-04-151-5/+124
| | | | | | | | ``/find`` which we've never seen before, because those members only have an address record, not a user record. This requires a small change in the API where the JSON response's ``address`` key now contains the URL to the address resource, the new ``email`` key contains the email address as a string, and the ``user`` key is optional.
* Trunk mergeBarry Warsaw2014-04-141-1/+1
|\
| * Bump copyright years.Barry Warsaw2014-01-011-1/+1
| |
* | Aurélien Bompard's import-from-2.1 branch, with cleanup and fixes.Barry Warsaw2014-04-141-1/+2
|/
* Bump copyright years.Barry Warsaw2013-01-011-1/+1
|
* * Python 2.7 is not required. Python 2.6 is no longer officially supported.Barry Warsaw2012-10-311-67/+28
| | | | | The code base is now also `python2.7 -3` clean, although there are still some warnings in 3rd party dependencies. LP: #1073506
* * The link between members and the mailing lists they are subscribed to, isBarry Warsaw2012-09-041-5/+5
| | | | | | | | | | | | | | | 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)
* - Module modernization by adding the print_function() import.Barry Warsaw2012-04-221-28/+30
| | | | - Update many tests to use the transaction() context manager.
* Schema change. After discussion at Pycon, we decided to change "real_name" toBarry Warsaw2012-03-151-2/+2
| | | | | | | | | | | "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)
* copybumpBarry Warsaw2012-01-011-1/+1
|
* Remove extraneous `test_suite()` functions. zope.testrunner willBarry Warsaw2011-10-301-8/+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.
* * Preferences for addresses, users, and members can be accessed, changed, andBarry Warsaw2011-09-231-0/+11
| | | | | | deleted through the REST interface. Hierarchical, combined preferences for members, and system preferences can be read through the REST interface. (LP: #821438)
* * You can now query or change a member's `delivery_mode` attribute throughBarry Warsaw2011-09-011-1/+11
|\ | | | | | | the REST API (LP: #833132). Given by Stephen A. Goss.
* | * PATCHing an invalid attribute on a member did not give a 400 errorBarry Warsaw2011-09-011-0/+16
|/ | | | (LP: #833376). Given by Stephen A. Goss.
* * Fixed incorrect error code for /members/<bogus> (LP: #821020). Given byBarry Warsaw2011-08-141-0/+10
| | | | Stephen A. Goss.
* Complete the ability to change a subscription address, both internally and viaBarry Warsaw2011-04-251-2/+2
| | | | | | | | | | | | | | the REST API. (LP: #643949) * New resource path in REST API: /addresses/<email>/memberships gets all the memberships for a given email address. * In the REST API, PUTting or PATCHing a list configuration now returns a 204 (No Content) success code instead of a 200 success code with an empty body. * When a user is subscribed with their preferred address, changing the preferred address also changes all subscriptions. * When a user is subscribed with a specific address, their subscription can be changed to any verified address they control. * Use a new naming scheme for doctests with multiple mailing lists.
* Allow users to subscribe to mailing lists through the REST API.Barry Warsaw2011-04-241-4/+4
| | | | | | | | * ISubscriptionService.join(): address -> subscriber. This is not backward compatible with the previous API! * Add get_user_by_id() to the IUserManager interface. It was already implemented, but the interface was missing the definition. * MissingUserError: new exception, purely for the REST API.
* Users subscribed to a mailing list via their preferred address show upBarry Warsaw2011-04-221-8/+42
| | | | | correctly in the REST API's list of members. This even correctly tracks changes in their preferred address.
* Give IMembers a unique member id. We have to do this in order to give them aBarry Warsaw2011-04-221-7/+12
| | | | | | | | | | | | | | | | | | | | | | | path at the root of the resource tree (i.e. /members/X) and because when members can be subscribed by their IUser record (for preferred address), their canonical location cannot contain the address they are subscribed with. When their preferred address changes (without otherwise touching their membership), this address will change and that's not good for a canonical location. Other changes: * Added IMember.member_id attribute * Added ISubscriptionService.get_member() so member records can be retrieve by member id. * We can now get individual members by id via the REST API. * Extend the UniqueIDFactory so that it can take a 'context' (defaulting to None). The context is only used in the testing infrastructure so that separate files can be used for user ids and member ids. Otherwise, we'd have gaps in those sequences. * When *not* in testing mode, ensure that UIDs cannot be reused by keeping a table of all UIDs ever handed out. We *should* never get collisions, but this ensures it. * Clean up mailman.sql
* * Move members.txt corner cases to unittests.Barry Warsaw2011-04-201-0/+162
* Fix a case in a list's /members API where the listname is bogus. * Catch NotAMemberError form delete_member() and return not_found. * Refactor REST helpers so that call_api() can be used in unittests without doing any prints to stdout.