diff --git a/src/postorius/tests/fixtures/vcr_cassettes/test_list_summary_secondary_moderator.yaml b/src/postorius/tests/fixtures/vcr_cassettes/test_list_summary_secondary_moderator.yaml new file mode 100644 index 0000000..0e01252 --- /dev/null +++ b/src/postorius/tests/fixtures/vcr_cassettes/test_list_summary_secondary_moderator.yaml @@ -0,0 +1,313 @@ +interactions: +- request: + body: display_name=&password=None&email=test%40example.com + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'content-type': [!!python/unicode 'application/x-www-form-urlencoded'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'POST' + uri: http://localhost:9001/3.0/users + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + date: ['Wed, 11 Nov 2015 09:15:54 GMT'] + location: ['http://localhost:9001/3.0/users/270387690459968603267458687775118477393'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 201, message: Created} +- request: + body: email=anotheremail%40example.com + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'content-type': [!!python/unicode 'application/x-www-form-urlencoded'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'POST' + uri: http://localhost:9001/3.0/users/270387690459968603267458687775118477393/addresses + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + date: ['Wed, 11 Nov 2015 09:15:55 GMT'] + location: ['http://localhost:9001/3.0/addresses/anotheremail@example.com'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 201, message: Created} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'POST' + uri: http://localhost:9001/3.0/addresses/anotheremail@example.com/verify + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + date: ['Wed, 11 Nov 2015 09:15:55 GMT'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 204, message: No Content} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/lists/foo@example.com + response: + body: {string: !!python/unicode '{"list_id": "foo.example.com", "mail_host": "example.com", + "list_name": "foo", "member_count": 0, "self_link": "http://localhost:9001/3.0/lists/foo.example.com", + "fqdn_listname": "foo@example.com", "volume": 1, "http_etag": "\"698a819bbb6b902096a8c5543cc7fac2328960d5\"", + "display_name": "Foo"}'} + headers: + content-length: ['294'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Nov 2015 09:15:55 GMT'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 200, message: OK} +- request: + body: role=moderator&list_id=foo.example.com&subscriber=anotheremail%40example.com + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'content-type': [!!python/unicode 'application/x-www-form-urlencoded'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'POST' + uri: http://localhost:9001/3.0/members + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + date: ['Wed, 11 Nov 2015 09:15:55 GMT'] + location: ['http://localhost:9001/3.0/members/167810063128386830859080802237709622397'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 201, message: Created} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/lists/foo@example.com + response: + body: {string: !!python/unicode '{"list_id": "foo.example.com", "mail_host": "example.com", + "list_name": "foo", "member_count": 0, "self_link": "http://localhost:9001/3.0/lists/foo.example.com", + "fqdn_listname": "foo@example.com", "volume": 1, "http_etag": "\"698a819bbb6b902096a8c5543cc7fac2328960d5\"", + "display_name": "Foo"}'} + headers: + content-length: ['294'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Nov 2015 09:15:55 GMT'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/users/test@example.com + response: + body: {string: !!python/unicode '{"self_link": "http://localhost:9001/3.0/users/270387690459968603267458687775118477393", + "created_on": "2015-11-11T09:15:54.098984", "user_id": 270387690459968603267458687775118477393, + "http_etag": "\"b1f415040c829e111a4cad8afd8efeda7bda929a\"", "password": "$6$rounds=626264$cNtQFSnFZ4S/DTbL$fp.zIYsm6IC34B46G0LugZtfY8E93Oojw.hTmFH7YRcX6k8K/pEk/U4hrIC8DmSCTvtmoCqactE7cS9i6Wns0/", + "is_server_owner": false}'} + headers: + content-length: ['407'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Nov 2015 09:15:55 GMT'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/users/270387690459968603267458687775118477393 + response: + body: {string: !!python/unicode '{"self_link": "http://localhost:9001/3.0/users/270387690459968603267458687775118477393", + "created_on": "2015-11-11T09:15:54.098984", "user_id": 270387690459968603267458687775118477393, + "http_etag": "\"b1f415040c829e111a4cad8afd8efeda7bda929a\"", "password": "$6$rounds=626264$cNtQFSnFZ4S/DTbL$fp.zIYsm6IC34B46G0LugZtfY8E93Oojw.hTmFH7YRcX6k8K/pEk/U4hrIC8DmSCTvtmoCqactE7cS9i6Wns0/", + "is_server_owner": false}'} + headers: + content-length: ['407'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Nov 2015 09:15:55 GMT'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/users/270387690459968603267458687775118477393/addresses + response: + body: {string: !!python/unicode '{"http_etag": "\"095c886cc2c87267e121d4a1974b495183e6fd93\"", + "start": 0, "total_size": 2, "entries": [{"self_link": "http://localhost:9001/3.0/addresses/anotheremail@example.com", + "registered_on": "2015-11-11T09:15:54.974939", "http_etag": "\"989cb1d30416a8dd9f2f7abf31a94c085af851c6\"", + "user": "http://localhost:9001/3.0/users/270387690459968603267458687775118477393", + "email": "anotheremail@example.com", "verified_on": "2015-11-11T09:15:55.068609", + "original_email": "anotheremail@example.com"}, {"self_link": "http://localhost:9001/3.0/addresses/test@example.com", + "registered_on": "2015-11-11T09:15:54.098549", "http_etag": "\"c95a6da19b8041a3a01d616f8daa2115690badfc\"", + "user": "http://localhost:9001/3.0/users/270387690459968603267458687775118477393", + "email": "test@example.com", "original_email": "test@example.com"}]}'} + headers: + content-length: ['830'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Nov 2015 09:15:55 GMT'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/addresses/anotheremail@example.com + response: + body: {string: !!python/unicode '{"self_link": "http://localhost:9001/3.0/addresses/anotheremail@example.com", + "registered_on": "2015-11-11T09:15:54.974939", "http_etag": "\"989cb1d30416a8dd9f2f7abf31a94c085af851c6\"", + "user": "http://localhost:9001/3.0/users/270387690459968603267458687775118477393", + "email": "anotheremail@example.com", "verified_on": "2015-11-11T09:15:55.068609", + "original_email": "anotheremail@example.com"}'} + headers: + content-length: ['396'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Nov 2015 09:15:55 GMT'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/addresses/test@example.com + response: + body: {string: !!python/unicode '{"self_link": "http://localhost:9001/3.0/addresses/test@example.com", + "registered_on": "2015-11-11T09:15:54.098549", "http_etag": "\"c95a6da19b8041a3a01d616f8daa2115690badfc\"", + "user": "http://localhost:9001/3.0/users/270387690459968603267458687775118477393", + "email": "test@example.com", "original_email": "test@example.com"}'} + headers: + content-length: ['327'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Nov 2015 09:15:55 GMT'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/lists/foo.example.com/roster/owner + response: + body: {string: !!python/unicode '{"http_etag": "\"32223434a0f3af4cdc4673d1fbc5bac1f6d98fd3\"", + "start": 0, "total_size": 0}'} + headers: + content-length: ['580'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Nov 2015 09:15:55 GMT'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/lists/foo.example.com/roster/moderator + response: + body: {string: !!python/unicode '{"http_etag": "\"4d9619b758f2e0c5bf8f7c65460e199a9a13ad65\"", + "start": 0, "total_size": 1, "entries": [{"self_link": "http://localhost:9001/3.0/members/167810063128386830859080802237709622397", + "member_id": 167810063128386830859080802237709622397, "role": "moderator", "http_etag": + "\"7ffccfad084044c9b107a08e659d827ee46d1500\"", "user": "http://localhost:9001/3.0/users/270387690459968603267458687775118477393", + "address": "http://localhost:9001/3.0/addresses/anotheremail@example.com", + "email": "anotheremail@example.com", "list_id": "foo.example.com", "delivery_mode": + "regular"}]}'} + headers: + content-length: ['90'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Nov 2015 09:15:55 GMT'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/lists/foo.example.com/member/test@example.com + response: + body: {string: !!python/unicode '{}'} + headers: + content-length: ['2'] + content-type: [application/json] + date: ['Wed, 11 Nov 2015 09:15:55 GMT'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 404, message: Not Found} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/lists/foo.example.com/member/anotheremail@example.com + response: + body: {string: !!python/unicode '{}'} + headers: + content-length: ['2'] + content-type: [application/json] + date: ['Wed, 11 Nov 2015 09:15:55 GMT'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 404, message: Not Found} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/lists/foo@example.com/config + response: + body: {string: !!python/unicode '{"filter_content": false, "display_name": "Foo", + "autorespond_postings": "none", "autorespond_requests": "none", "web_host": + "example.com", "volume": 1, "include_rfc2369_headers": true, "subscription_policy": + "confirm", "admin_immed_notify": true, "mail_host": "example.com", "posting_pipeline": + "default-posting-pipeline", "join_address": "foo-join@example.com", "administrivia": + true, "autorespond_owner": "none", "no_reply_address": "noreply@example.com", + "archive_policy": "public", "digest_size_threshold": 30.0, "request_address": + "foo-request@example.com", "admin_notify_mchanges": false, "welcome_message_uri": + "mailman:///welcome.txt", "scheme": "http", "default_nonmember_action": "hold", + "convert_html_to_plaintext": false, "autoresponse_owner_text": "", "description": + "", "list_name": "foo", "bounces_address": "foo-bounces@example.com", "subject_prefix": + "[Foo] ", "posting_address": "foo@example.com", "reply_goes_to_list": "no_munging", + "anonymous_list": false, "autoresponse_postings_text": "", "post_id": 1, "allow_list_posts": + true, "next_digest_number": 1, "created_at": "2015-11-11T09:15:53.622121", + "collapse_alternatives": true, "owner_address": "foo-owner@example.com", "acceptable_aliases": + [], "last_post_at": null, "first_strip_reply_to": false, "reply_to_address": + "", "leave_address": "foo-leave@example.com", "fqdn_listname": "foo@example.com", + "send_welcome_message": true, "default_member_action": "defer", "advertised": + true, "autoresponse_grace_period": "90d", "http_etag": "\"a10382b38c19ab3f96aba0b521660b0a3bec0b5f\"", + "autoresponse_request_text": "", "digest_last_sent_at": null}'} + headers: + content-length: ['1617'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Nov 2015 09:15:55 GMT'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 200, message: OK} +version: 1 diff --git a/src/postorius/tests/fixtures/vcr_cassettes/test_list_summary_secondary_owner.yaml b/src/postorius/tests/fixtures/vcr_cassettes/test_list_summary_secondary_owner.yaml new file mode 100644 index 0000000..923c1bf --- /dev/null +++ b/src/postorius/tests/fixtures/vcr_cassettes/test_list_summary_secondary_owner.yaml @@ -0,0 +1,313 @@ +interactions: +- request: + body: display_name=&password=None&email=test%40example.com + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'content-type': [!!python/unicode 'application/x-www-form-urlencoded'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'POST' + uri: http://localhost:9001/3.0/users + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + date: ['Wed, 11 Nov 2015 09:15:54 GMT'] + location: ['http://localhost:9001/3.0/users/270387690459968603267458687775118477393'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 201, message: Created} +- request: + body: email=anotheremail%40example.com + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'content-type': [!!python/unicode 'application/x-www-form-urlencoded'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'POST' + uri: http://localhost:9001/3.0/users/270387690459968603267458687775118477393/addresses + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + date: ['Wed, 11 Nov 2015 09:15:55 GMT'] + location: ['http://localhost:9001/3.0/addresses/anotheremail@example.com'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 201, message: Created} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'POST' + uri: http://localhost:9001/3.0/addresses/anotheremail@example.com/verify + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + date: ['Wed, 11 Nov 2015 09:15:55 GMT'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 204, message: No Content} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/lists/foo@example.com + response: + body: {string: !!python/unicode '{"list_id": "foo.example.com", "mail_host": "example.com", + "list_name": "foo", "member_count": 0, "self_link": "http://localhost:9001/3.0/lists/foo.example.com", + "fqdn_listname": "foo@example.com", "volume": 1, "http_etag": "\"698a819bbb6b902096a8c5543cc7fac2328960d5\"", + "display_name": "Foo"}'} + headers: + content-length: ['294'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Nov 2015 09:15:55 GMT'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 200, message: OK} +- request: + body: role=owner&list_id=foo.example.com&subscriber=anotheremail%40example.com + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'content-type': [!!python/unicode 'application/x-www-form-urlencoded'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'POST' + uri: http://localhost:9001/3.0/members + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + date: ['Wed, 11 Nov 2015 09:15:55 GMT'] + location: ['http://localhost:9001/3.0/members/167810063128386830859080802237709622397'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 201, message: Created} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/lists/foo@example.com + response: + body: {string: !!python/unicode '{"list_id": "foo.example.com", "mail_host": "example.com", + "list_name": "foo", "member_count": 0, "self_link": "http://localhost:9001/3.0/lists/foo.example.com", + "fqdn_listname": "foo@example.com", "volume": 1, "http_etag": "\"698a819bbb6b902096a8c5543cc7fac2328960d5\"", + "display_name": "Foo"}'} + headers: + content-length: ['294'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Nov 2015 09:15:55 GMT'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/users/test@example.com + response: + body: {string: !!python/unicode '{"self_link": "http://localhost:9001/3.0/users/270387690459968603267458687775118477393", + "created_on": "2015-11-11T09:15:54.098984", "user_id": 270387690459968603267458687775118477393, + "http_etag": "\"b1f415040c829e111a4cad8afd8efeda7bda929a\"", "password": "$6$rounds=626264$cNtQFSnFZ4S/DTbL$fp.zIYsm6IC34B46G0LugZtfY8E93Oojw.hTmFH7YRcX6k8K/pEk/U4hrIC8DmSCTvtmoCqactE7cS9i6Wns0/", + "is_server_owner": false}'} + headers: + content-length: ['407'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Nov 2015 09:15:55 GMT'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/users/270387690459968603267458687775118477393 + response: + body: {string: !!python/unicode '{"self_link": "http://localhost:9001/3.0/users/270387690459968603267458687775118477393", + "created_on": "2015-11-11T09:15:54.098984", "user_id": 270387690459968603267458687775118477393, + "http_etag": "\"b1f415040c829e111a4cad8afd8efeda7bda929a\"", "password": "$6$rounds=626264$cNtQFSnFZ4S/DTbL$fp.zIYsm6IC34B46G0LugZtfY8E93Oojw.hTmFH7YRcX6k8K/pEk/U4hrIC8DmSCTvtmoCqactE7cS9i6Wns0/", + "is_server_owner": false}'} + headers: + content-length: ['407'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Nov 2015 09:15:55 GMT'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/users/270387690459968603267458687775118477393/addresses + response: + body: {string: !!python/unicode '{"http_etag": "\"095c886cc2c87267e121d4a1974b495183e6fd93\"", + "start": 0, "total_size": 2, "entries": [{"self_link": "http://localhost:9001/3.0/addresses/anotheremail@example.com", + "registered_on": "2015-11-11T09:15:54.974939", "http_etag": "\"989cb1d30416a8dd9f2f7abf31a94c085af851c6\"", + "user": "http://localhost:9001/3.0/users/270387690459968603267458687775118477393", + "email": "anotheremail@example.com", "verified_on": "2015-11-11T09:15:55.068609", + "original_email": "anotheremail@example.com"}, {"self_link": "http://localhost:9001/3.0/addresses/test@example.com", + "registered_on": "2015-11-11T09:15:54.098549", "http_etag": "\"c95a6da19b8041a3a01d616f8daa2115690badfc\"", + "user": "http://localhost:9001/3.0/users/270387690459968603267458687775118477393", + "email": "test@example.com", "original_email": "test@example.com"}]}'} + headers: + content-length: ['830'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Nov 2015 09:15:55 GMT'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/addresses/anotheremail@example.com + response: + body: {string: !!python/unicode '{"self_link": "http://localhost:9001/3.0/addresses/anotheremail@example.com", + "registered_on": "2015-11-11T09:15:54.974939", "http_etag": "\"989cb1d30416a8dd9f2f7abf31a94c085af851c6\"", + "user": "http://localhost:9001/3.0/users/270387690459968603267458687775118477393", + "email": "anotheremail@example.com", "verified_on": "2015-11-11T09:15:55.068609", + "original_email": "anotheremail@example.com"}'} + headers: + content-length: ['396'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Nov 2015 09:15:55 GMT'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/addresses/test@example.com + response: + body: {string: !!python/unicode '{"self_link": "http://localhost:9001/3.0/addresses/test@example.com", + "registered_on": "2015-11-11T09:15:54.098549", "http_etag": "\"c95a6da19b8041a3a01d616f8daa2115690badfc\"", + "user": "http://localhost:9001/3.0/users/270387690459968603267458687775118477393", + "email": "test@example.com", "original_email": "test@example.com"}'} + headers: + content-length: ['327'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Nov 2015 09:15:55 GMT'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/lists/foo.example.com/roster/owner + response: + body: {string: !!python/unicode '{"http_etag": "\"4d9619b758f2e0c5bf8f7c65460e199a9a13ad65\"", + "start": 0, "total_size": 1, "entries": [{"self_link": "http://localhost:9001/3.0/members/167810063128386830859080802237709622397", + "member_id": 167810063128386830859080802237709622397, "role": "owner", "http_etag": + "\"7ffccfad084044c9b107a08e659d827ee46d1500\"", "user": "http://localhost:9001/3.0/users/270387690459968603267458687775118477393", + "address": "http://localhost:9001/3.0/addresses/anotheremail@example.com", + "email": "anotheremail@example.com", "list_id": "foo.example.com", "delivery_mode": + "regular"}]}'} + headers: + content-length: ['580'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Nov 2015 09:15:55 GMT'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/lists/foo.example.com/roster/moderator + response: + body: {string: !!python/unicode '{"http_etag": "\"32223434a0f3af4cdc4673d1fbc5bac1f6d98fd3\"", + "start": 0, "total_size": 0}'} + headers: + content-length: ['90'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Nov 2015 09:15:55 GMT'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/lists/foo.example.com/member/test@example.com + response: + body: {string: !!python/unicode '{}'} + headers: + content-length: ['2'] + content-type: [application/json] + date: ['Wed, 11 Nov 2015 09:15:55 GMT'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 404, message: Not Found} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/lists/foo.example.com/member/anotheremail@example.com + response: + body: {string: !!python/unicode '{}'} + headers: + content-length: ['2'] + content-type: [application/json] + date: ['Wed, 11 Nov 2015 09:15:55 GMT'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 404, message: Not Found} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode 'authorization': [!!python/unicode 'Basic cmVzdGFkbWluOnJlc3RwYXNz'] + !!python/unicode 'user-agent': [!!python/unicode 'GNU Mailman REST client v1.0.0'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/lists/foo@example.com/config + response: + body: {string: !!python/unicode '{"filter_content": false, "display_name": "Foo", + "autorespond_postings": "none", "autorespond_requests": "none", "web_host": + "example.com", "volume": 1, "include_rfc2369_headers": true, "subscription_policy": + "confirm", "admin_immed_notify": true, "mail_host": "example.com", "posting_pipeline": + "default-posting-pipeline", "join_address": "foo-join@example.com", "administrivia": + true, "autorespond_owner": "none", "no_reply_address": "noreply@example.com", + "archive_policy": "public", "digest_size_threshold": 30.0, "request_address": + "foo-request@example.com", "admin_notify_mchanges": false, "welcome_message_uri": + "mailman:///welcome.txt", "scheme": "http", "default_nonmember_action": "hold", + "convert_html_to_plaintext": false, "autoresponse_owner_text": "", "description": + "", "list_name": "foo", "bounces_address": "foo-bounces@example.com", "subject_prefix": + "[Foo] ", "posting_address": "foo@example.com", "reply_goes_to_list": "no_munging", + "anonymous_list": false, "autoresponse_postings_text": "", "post_id": 1, "allow_list_posts": + true, "next_digest_number": 1, "created_at": "2015-11-11T09:15:53.622121", + "collapse_alternatives": true, "owner_address": "foo-owner@example.com", "acceptable_aliases": + [], "last_post_at": null, "first_strip_reply_to": false, "reply_to_address": + "", "leave_address": "foo-leave@example.com", "fqdn_listname": "foo@example.com", + "send_welcome_message": true, "default_member_action": "defer", "advertised": + true, "autoresponse_grace_period": "90d", "http_etag": "\"a10382b38c19ab3f96aba0b521660b0a3bec0b5f\"", + "autoresponse_request_text": "", "digest_last_sent_at": null}'} + headers: + content-length: ['1617'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Nov 2015 09:15:55 GMT'] + server: [WSGIServer/0.2 CPython/3.4.2] + status: {code: 200, message: OK} +version: 1 diff --git a/src/postorius/tests/mailman_api_tests/test_list_summary.py b/src/postorius/tests/mailman_api_tests/test_list_summary.py index f879055..f12a88e 100644 --- a/src/postorius/tests/mailman_api_tests/test_list_summary.py +++ b/src/postorius/tests/mailman_api_tests/test_list_summary.py @@ -111,3 +111,31 @@ self.assertEqual(response.status_code, 200) self.assertTrue('Change Subscription' in response.content) self.assertTrue('Unsubscribe' in response.content) + + @MM_VCR.use_cassette('test_list_summary_secondary_owner.yaml') + def test_list_summary_is_admin_secondary_owner(self): + # Response must contain the administration menu + user = self.mmclient.create_user('test@example.com', None) + address = user.add_address('anotheremail@example.com') + address.verify() + mlist = self.mmclient.get_list('foo@example.com') + mlist.add_owner('anotheremail@example.com') + self.client.login(username='testuser', password='testpass') + response = self.client.get(reverse('list_summary', + args=('foo@example.com', ))) + self.assertEqual(response.status_code, 200) + self.assertContains(response, '