diff --git a/src/postorius/templates/postorius/user/list_options.html b/src/postorius/templates/postorius/user/list_options.html index a766b8a..ca08666 100644 --- a/src/postorius/templates/postorius/user/list_options.html +++ b/src/postorius/templates/postorius/user/list_options.html @@ -4,7 +4,7 @@ {% load bootstrap_tags %} {% block subtitle %} -{% trans 'Member options' %} | {{ list.list_fqdn }} +{% trans 'Member options' %} | {{ list.fqdn_listname }} {% endblock %} {% block main %} diff --git a/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_change_subscription_confirm.yaml b/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_change_subscription_confirm.yaml new file mode 100644 index 0000000..9d73309 --- /dev/null +++ b/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_change_subscription_confirm.yaml @@ -0,0 +1,764 @@ +interactions: +- request: + body: mail_host=example.com + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] + method: !!python/unicode POST + uri: http://localhost:9001/3.0/domains + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + location: ['http://localhost:9001/3.0/domains/example.com'] + status: {code: 201, message: Created} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/domains/example.com + response: + body: {string: !!python/unicode '{"base_url": "http://example.com", "description": + null, "http_etag": "\"e736411818ff1815ca83575e0958c38c5188f0a4\"", "mail_host": + "example.com", "self_link": "http://localhost:9001/3.0/domains/example.com", + "url_host": "example.com"}'} + headers: + content-length: ['233'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: fqdn_listname=open_list%40example.com + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] + method: !!python/unicode POST + uri: http://localhost:9001/3.0/lists + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + location: ['http://localhost:9001/3.0/lists/open_list.example.com'] + status: {code: 201, message: Created} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/open_list.example.com + response: + body: {string: !!python/unicode '{"display_name": "Open_list", "fqdn_listname": + "open_list@example.com", "http_etag": "\"6726e101e1dd1de6043eee72f741d4c2479f4735\"", + "list_id": "open_list.example.com", "list_name": "open_list", "mail_host": + "example.com", "member_count": 0, "self_link": "http://localhost:9001/3.0/lists/open_list.example.com", + "volume": 1}'} + headers: + content-length: ['324'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/open_list@example.com/config + response: + body: {string: !!python/unicode '{"acceptable_aliases": [], "admin_immed_notify": + true, "admin_notify_mchanges": false, "administrivia": true, "advertised": + true, "allow_list_posts": true, "anonymous_list": false, "archive_policy": + "public", "autorespond_owner": "none", "autorespond_postings": "none", "autorespond_requests": + "none", "autoresponse_grace_period": "90d", "autoresponse_owner_text": "", + "autoresponse_postings_text": "", "autoresponse_request_text": "", "bounces_address": + "open_list-bounces@example.com", "collapse_alternatives": true, "convert_html_to_plaintext": + false, "created_at": "2005-08-01T07:49:23", "default_member_action": "defer", + "default_nonmember_action": "hold", "description": "", "digest_last_sent_at": + null, "digest_send_periodic": true, "digest_size_threshold": 30.0, "digest_volume_frequency": + "monthly", "digests_enabled": true, "display_name": "Open_list", "filter_content": + false, "first_strip_reply_to": false, "fqdn_listname": "open_list@example.com", + "goodbye_message_uri": "", "http_etag": "\"3d16b6c6d1bb8fed130bd061c70a0894856a4ca8\"", + "include_rfc2369_headers": true, "join_address": "open_list-join@example.com", + "last_post_at": null, "leave_address": "open_list-leave@example.com", "list_name": + "open_list", "mail_host": "example.com", "next_digest_number": 1, "no_reply_address": + "noreply@example.com", "owner_address": "open_list-owner@example.com", "post_id": + 1, "posting_address": "open_list@example.com", "posting_pipeline": "default-posting-pipeline", + "reply_goes_to_list": "no_munging", "reply_to_address": "", "request_address": + "open_list-request@example.com", "scheme": "http", "send_welcome_message": + true, "subject_prefix": "[Open_list] ", "subscription_policy": "confirm", + "volume": 1, "web_host": "example.com", "welcome_message_uri": "mailman:///welcome.txt"}'} + headers: + content-length: ['1790'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: subscription_policy=open + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] + method: !!python/unicode PATCH + uri: http://localhost:9001/3.0/lists/open_list@example.com/config + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + status: {code: 204, message: No Content} +- request: + body: fqdn_listname=moderate_subs%40example.com + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] + method: !!python/unicode POST + uri: http://localhost:9001/3.0/lists + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + location: ['http://localhost:9001/3.0/lists/moderate_subs.example.com'] + status: {code: 201, message: Created} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/moderate_subs.example.com + response: + body: {string: !!python/unicode '{"display_name": "Moderate_subs", "fqdn_listname": + "moderate_subs@example.com", "http_etag": "\"4cf5a031a451ad84a54e4c708cacda8e676e617f\"", + "list_id": "moderate_subs.example.com", "list_name": "moderate_subs", "mail_host": + "example.com", "member_count": 0, "self_link": "http://localhost:9001/3.0/lists/moderate_subs.example.com", + "volume": 1}'} + headers: + content-length: ['344'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/moderate_subs@example.com/config + response: + body: {string: !!python/unicode '{"acceptable_aliases": [], "admin_immed_notify": + true, "admin_notify_mchanges": false, "administrivia": true, "advertised": + true, "allow_list_posts": true, "anonymous_list": false, "archive_policy": + "public", "autorespond_owner": "none", "autorespond_postings": "none", "autorespond_requests": + "none", "autoresponse_grace_period": "90d", "autoresponse_owner_text": "", + "autoresponse_postings_text": "", "autoresponse_request_text": "", "bounces_address": + "moderate_subs-bounces@example.com", "collapse_alternatives": true, "convert_html_to_plaintext": + false, "created_at": "2005-08-01T07:49:23", "default_member_action": "defer", + "default_nonmember_action": "hold", "description": "", "digest_last_sent_at": + null, "digest_send_periodic": true, "digest_size_threshold": 30.0, "digest_volume_frequency": + "monthly", "digests_enabled": true, "display_name": "Moderate_subs", "filter_content": + false, "first_strip_reply_to": false, "fqdn_listname": "moderate_subs@example.com", + "goodbye_message_uri": "", "http_etag": "\"bbeb372001a49a25fa038477abd59e8b3c45a20d\"", + "include_rfc2369_headers": true, "join_address": "moderate_subs-join@example.com", + "last_post_at": null, "leave_address": "moderate_subs-leave@example.com", + "list_name": "moderate_subs", "mail_host": "example.com", "next_digest_number": + 1, "no_reply_address": "noreply@example.com", "owner_address": "moderate_subs-owner@example.com", + "post_id": 1, "posting_address": "moderate_subs@example.com", "posting_pipeline": + "default-posting-pipeline", "reply_goes_to_list": "no_munging", "reply_to_address": + "", "request_address": "moderate_subs-request@example.com", "scheme": "http", + "send_welcome_message": true, "subject_prefix": "[Moderate_subs] ", "subscription_policy": + "confirm", "volume": 1, "web_host": "example.com", "welcome_message_uri": + "mailman:///welcome.txt"}'} + headers: + content-length: ['1830'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: subscription_policy=moderate + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] + method: !!python/unicode PATCH + uri: http://localhost:9001/3.0/lists/moderate_subs@example.com/config + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + status: {code: 204, message: No Content} +- request: + body: email=test%40example.com + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] + method: !!python/unicode POST + uri: http://localhost:9001/3.0/users + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + location: ['http://localhost:9001/3.0/users/1'] + status: {code: 201, message: Created} +- request: + body: email=fritz%40example.org + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] + method: !!python/unicode POST + uri: http://localhost:9001/3.0/users/1/addresses + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + location: ['http://localhost:9001/3.0/addresses/fritz@example.org'] + status: {code: 201, message: Created} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/users/1 + response: + body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": + "\"63f8d56eaf2545a495a9b61acc47e2fa62697073\"", "is_server_owner": false, + "password": "$6$rounds=609031$uX4mXc7izwD/c7W.$TTI/uoqKq569Qi7qndf4JrjeVG.coAuyZy78NDZ/Qv4ZKWRGVHa/OVQghW8aJwAGmoKnbkrFcTd0LNkC9tJcG0", + "self_link": "http://localhost:9001/3.0/users/1", "user_id": 1}'} + headers: + content-length: ['324'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/users/1/addresses + response: + body: {string: !!python/unicode '{"entries": [{"email": "fritz@example.org", "http_etag": + "\"e285d46d0149da55f7d4f0a0ba35a34ea5168d9b\"", "original_email": "fritz@example.org", + "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/fritz@example.org", + "user": "http://localhost:9001/3.0/users/1"}, {"email": "test@example.com", + "http_etag": "\"0e805a389459bccaa6e81517808582547119e624\"", "original_email": + "test@example.com", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/test@example.com", + "user": "http://localhost:9001/3.0/users/1"}], "http_etag": "\"65df5bc7faf13eaa5672d528649796ce0361c3cb\"", + "start": 0, "total_size": 2}'} + headers: + content-length: ['674'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode POST + uri: http://localhost:9001/3.0/addresses/fritz@example.org/verify + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + status: {code: 204, message: No Content} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode POST + uri: http://localhost:9001/3.0/addresses/test@example.com/verify + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + status: {code: 204, message: No Content} +- request: + body: fqdn_listname=confirm_list%40example.com + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] + method: !!python/unicode POST + uri: http://localhost:9001/3.0/lists + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + location: ['http://localhost:9001/3.0/lists/confirm_list.example.com'] + status: {code: 201, message: Created} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/confirm_list.example.com + response: + body: {string: !!python/unicode '{"display_name": "Confirm_list", "fqdn_listname": + "confirm_list@example.com", "http_etag": "\"bd3927fe8bb6a9ab3eedb2ca8e8676bc171776f5\"", + "list_id": "confirm_list.example.com", "list_name": "confirm_list", "mail_host": + "example.com", "member_count": 0, "self_link": "http://localhost:9001/3.0/lists/confirm_list.example.com", + "volume": 1}'} + headers: + content-length: ['339'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/confirm_list@example.com/config + response: + body: {string: !!python/unicode '{"acceptable_aliases": [], "admin_immed_notify": + true, "admin_notify_mchanges": false, "administrivia": true, "advertised": + true, "allow_list_posts": true, "anonymous_list": false, "archive_policy": + "public", "autorespond_owner": "none", "autorespond_postings": "none", "autorespond_requests": + "none", "autoresponse_grace_period": "90d", "autoresponse_owner_text": "", + "autoresponse_postings_text": "", "autoresponse_request_text": "", "bounces_address": + "confirm_list-bounces@example.com", "collapse_alternatives": true, "convert_html_to_plaintext": + false, "created_at": "2005-08-01T07:49:23", "default_member_action": "defer", + "default_nonmember_action": "hold", "description": "", "digest_last_sent_at": + null, "digest_send_periodic": true, "digest_size_threshold": 30.0, "digest_volume_frequency": + "monthly", "digests_enabled": true, "display_name": "Confirm_list", "filter_content": + false, "first_strip_reply_to": false, "fqdn_listname": "confirm_list@example.com", + "goodbye_message_uri": "", "http_etag": "\"7cf2ddebec6fa45a26e2ba9abe83a8e8d2e36bb1\"", + "include_rfc2369_headers": true, "join_address": "confirm_list-join@example.com", + "last_post_at": null, "leave_address": "confirm_list-leave@example.com", "list_name": + "confirm_list", "mail_host": "example.com", "next_digest_number": 1, "no_reply_address": + "noreply@example.com", "owner_address": "confirm_list-owner@example.com", + "post_id": 1, "posting_address": "confirm_list@example.com", "posting_pipeline": + "default-posting-pipeline", "reply_goes_to_list": "no_munging", "reply_to_address": + "", "request_address": "confirm_list-request@example.com", "scheme": "http", + "send_welcome_message": true, "subject_prefix": "[Confirm_list] ", "subscription_policy": + "confirm", "volume": 1, "web_host": "example.com", "welcome_message_uri": + "mailman:///welcome.txt"}'} + headers: + content-length: ['1820'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: !!python/unicode + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] + method: !!python/unicode PATCH + uri: http://localhost:9001/3.0/lists/confirm_list@example.com/config + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + status: {code: 204, message: No Content} +- request: + body: display_name=None&list_id=confirm_list.example.com&pre_confirmed=True&subscriber=test%40example.com + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] + method: !!python/unicode POST + uri: http://localhost:9001/3.0/members + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + location: ['http://localhost:9001/3.0/members/1'] + status: {code: 201, message: Created} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/confirm_list@example.com/roster/member + response: + body: {string: !!python/unicode '{"entries": [{"address": "http://localhost:9001/3.0/addresses/test@example.com", + "delivery_mode": "regular", "email": "test@example.com", "http_etag": "\"82a667defcf1f397d8a12162596b1b791a0c260b\"", + "list_id": "confirm_list.example.com", "member_id": 1, "moderation_action": + "defer", "role": "member", "self_link": "http://localhost:9001/3.0/members/1", + "user": "http://localhost:9001/3.0/users/1"}], "http_etag": "\"686ae3138f0e50de15e75824cd4069e7245585af\"", + "start": 0, "total_size": 1}'} + headers: + content-length: ['490'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/confirm_list@example.com/requests + response: + body: {string: !!python/unicode '{"http_etag": "\"32223434a0f3af4cdc4673d1fbc5bac1f6d98fd3\"", + "start": 0, "total_size": 0}'} + headers: + content-length: ['90'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/users/test@example.com + response: + body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": + "\"63f8d56eaf2545a495a9b61acc47e2fa62697073\"", "is_server_owner": false, + "password": "$6$rounds=609031$uX4mXc7izwD/c7W.$TTI/uoqKq569Qi7qndf4JrjeVG.coAuyZy78NDZ/Qv4ZKWRGVHa/OVQghW8aJwAGmoKnbkrFcTd0LNkC9tJcG0", + "self_link": "http://localhost:9001/3.0/users/1", "user_id": 1}'} + headers: + content-length: ['324'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/users/1/addresses + response: + body: {string: !!python/unicode '{"entries": [{"email": "fritz@example.org", "http_etag": + "\"beba50816195251c83f486bbd257e29fd639385f\"", "original_email": "fritz@example.org", + "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/fritz@example.org", + "user": "http://localhost:9001/3.0/users/1", "verified_on": "2005-08-01T07:49:23"}, + {"email": "test@example.com", "http_etag": "\"2af8b40afeda1132c4f948baad6cb4c1cdf4cde6\"", + "original_email": "test@example.com", "registered_on": "2005-08-01T07:49:23", + "self_link": "http://localhost:9001/3.0/addresses/test@example.com", "user": + "http://localhost:9001/3.0/users/1", "verified_on": "2005-08-01T07:49:23"}], + "http_etag": "\"d3f526ca6a879a24e6cbe2502b8de27ec8110ba1\"", "start": 0, "total_size": + 2}'} + headers: + content-length: ['750'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/confirm_list.example.com + response: + body: {string: !!python/unicode '{"display_name": "Confirm_list", "fqdn_listname": + "confirm_list@example.com", "http_etag": "\"6d87cbc09fbdd9df81d41130f71095a875604126\"", + "list_id": "confirm_list.example.com", "list_name": "confirm_list", "mail_host": + "example.com", "member_count": 1, "self_link": "http://localhost:9001/3.0/lists/confirm_list.example.com", + "volume": 1}'} + headers: + content-length: ['339'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/confirm_list.example.com/roster/owner + response: + body: {string: !!python/unicode '{"http_etag": "\"32223434a0f3af4cdc4673d1fbc5bac1f6d98fd3\"", + "start": 0, "total_size": 0}'} + headers: + content-length: ['90'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/confirm_list.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] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/confirm_list.example.com/member/test@example.com + response: + body: {string: !!python/unicode '{"address": "http://localhost:9001/3.0/addresses/test@example.com", + "delivery_mode": "regular", "email": "test@example.com", "http_etag": "\"82a667defcf1f397d8a12162596b1b791a0c260b\"", + "list_id": "confirm_list.example.com", "member_id": 1, "moderation_action": + "defer", "role": "member", "self_link": "http://localhost:9001/3.0/members/1", + "user": "http://localhost:9001/3.0/users/1"}'} + headers: + content-length: ['385'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode DELETE + uri: http://localhost:9001/3.0/lists/confirm_list.example.com/member/test@example.com + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + status: {code: 204, message: No Content} +- request: + body: display_name=None&list_id=confirm_list.example.com&pre_confirmed=True&subscriber=fritz%40example.org + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] + method: !!python/unicode POST + uri: http://localhost:9001/3.0/members + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + location: ['http://localhost:9001/3.0/members/2'] + status: {code: 201, message: Created} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/confirm_list@example.com/roster/member + response: + body: {string: !!python/unicode '{"entries": [{"address": "http://localhost:9001/3.0/addresses/fritz@example.org", + "delivery_mode": "regular", "email": "fritz@example.org", "http_etag": "\"045190d9f0e8ac8de3235a2ed210b4f98cf0fcff\"", + "list_id": "confirm_list.example.com", "member_id": 2, "moderation_action": + "defer", "role": "member", "self_link": "http://localhost:9001/3.0/members/2", + "user": "http://localhost:9001/3.0/users/1"}], "http_etag": "\"08ecc66f3e4c1a046cd95959b2c2554297831e6f\"", + "start": 0, "total_size": 1}'} + headers: + content-length: ['492'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/confirm_list@example.com/requests + response: + body: {string: !!python/unicode '{"http_etag": "\"32223434a0f3af4cdc4673d1fbc5bac1f6d98fd3\"", + "start": 0, "total_size": 0}'} + headers: + content-length: ['90'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/confirm_list.example.com/member/fritz@example.org + response: + body: {string: !!python/unicode '{"address": "http://localhost:9001/3.0/addresses/fritz@example.org", + "delivery_mode": "regular", "email": "fritz@example.org", "http_etag": "\"045190d9f0e8ac8de3235a2ed210b4f98cf0fcff\"", + "list_id": "confirm_list.example.com", "member_id": 2, "moderation_action": + "defer", "role": "member", "self_link": "http://localhost:9001/3.0/members/2", + "user": "http://localhost:9001/3.0/users/1"}'} + headers: + content-length: ['387'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/users/test@example.com + response: + body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": + "\"63f8d56eaf2545a495a9b61acc47e2fa62697073\"", "is_server_owner": false, + "password": "$6$rounds=609031$uX4mXc7izwD/c7W.$TTI/uoqKq569Qi7qndf4JrjeVG.coAuyZy78NDZ/Qv4ZKWRGVHa/OVQghW8aJwAGmoKnbkrFcTd0LNkC9tJcG0", + "self_link": "http://localhost:9001/3.0/users/1", "user_id": 1}'} + headers: + content-length: ['324'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/users/1/addresses + response: + body: {string: !!python/unicode '{"entries": [{"email": "fritz@example.org", "http_etag": + "\"beba50816195251c83f486bbd257e29fd639385f\"", "original_email": "fritz@example.org", + "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/fritz@example.org", + "user": "http://localhost:9001/3.0/users/1", "verified_on": "2005-08-01T07:49:23"}, + {"email": "test@example.com", "http_etag": "\"2af8b40afeda1132c4f948baad6cb4c1cdf4cde6\"", + "original_email": "test@example.com", "registered_on": "2005-08-01T07:49:23", + "self_link": "http://localhost:9001/3.0/addresses/test@example.com", "user": + "http://localhost:9001/3.0/users/1", "verified_on": "2005-08-01T07:49:23"}], + "http_etag": "\"d3f526ca6a879a24e6cbe2502b8de27ec8110ba1\"", "start": 0, "total_size": + 2}'} + headers: + content-length: ['750'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/confirm_list.example.com + response: + body: {string: !!python/unicode '{"display_name": "Confirm_list", "fqdn_listname": + "confirm_list@example.com", "http_etag": "\"6d87cbc09fbdd9df81d41130f71095a875604126\"", + "list_id": "confirm_list.example.com", "list_name": "confirm_list", "mail_host": + "example.com", "member_count": 1, "self_link": "http://localhost:9001/3.0/lists/confirm_list.example.com", + "volume": 1}'} + headers: + content-length: ['339'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/confirm_list.example.com/roster/owner + response: + body: {string: !!python/unicode '{"http_etag": "\"32223434a0f3af4cdc4673d1fbc5bac1f6d98fd3\"", + "start": 0, "total_size": 0}'} + headers: + content-length: ['90'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/confirm_list.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] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/confirm_list.example.com/member/test@example.com + response: + body: {string: !!python/unicode '{}'} + headers: + content-length: ['2'] + content-type: [application/json] + status: {code: 404, message: Not Found} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/confirm_list.example.com/member/fritz@example.org + response: + body: {string: !!python/unicode '{"address": "http://localhost:9001/3.0/addresses/fritz@example.org", + "delivery_mode": "regular", "email": "fritz@example.org", "http_etag": "\"045190d9f0e8ac8de3235a2ed210b4f98cf0fcff\"", + "list_id": "confirm_list.example.com", "member_id": 2, "moderation_action": + "defer", "role": "member", "self_link": "http://localhost:9001/3.0/members/2", + "user": "http://localhost:9001/3.0/users/1"}'} + headers: + content-length: ['387'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/confirm_list@example.com/config + response: + body: {string: !!python/unicode '{"acceptable_aliases": [], "admin_immed_notify": + true, "admin_notify_mchanges": false, "administrivia": true, "advertised": + true, "allow_list_posts": true, "anonymous_list": false, "archive_policy": + "public", "autorespond_owner": "none", "autorespond_postings": "none", "autorespond_requests": + "none", "autoresponse_grace_period": "90d", "autoresponse_owner_text": "", + "autoresponse_postings_text": "", "autoresponse_request_text": "", "bounces_address": + "confirm_list-bounces@example.com", "collapse_alternatives": true, "convert_html_to_plaintext": + false, "created_at": "2005-08-01T07:49:23", "default_member_action": "defer", + "default_nonmember_action": "hold", "description": "", "digest_last_sent_at": + null, "digest_send_periodic": true, "digest_size_threshold": 30.0, "digest_volume_frequency": + "monthly", "digests_enabled": true, "display_name": "Confirm_list", "filter_content": + false, "first_strip_reply_to": false, "fqdn_listname": "confirm_list@example.com", + "goodbye_message_uri": "", "http_etag": "\"7cf2ddebec6fa45a26e2ba9abe83a8e8d2e36bb1\"", + "include_rfc2369_headers": true, "join_address": "confirm_list-join@example.com", + "last_post_at": null, "leave_address": "confirm_list-leave@example.com", "list_name": + "confirm_list", "mail_host": "example.com", "next_digest_number": 1, "no_reply_address": + "noreply@example.com", "owner_address": "confirm_list-owner@example.com", + "post_id": 1, "posting_address": "confirm_list@example.com", "posting_pipeline": + "default-posting-pipeline", "reply_goes_to_list": "no_munging", "reply_to_address": + "", "request_address": "confirm_list-request@example.com", "scheme": "http", + "send_welcome_message": true, "subject_prefix": "[Confirm_list] ", "subscription_policy": + "confirm", "volume": 1, "web_host": "example.com", "welcome_message_uri": + "mailman:///welcome.txt"}'} + headers: + content-length: ['1820'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/open_list@example.com/requests + response: + body: {string: !!python/unicode '{"http_etag": "\"32223434a0f3af4cdc4673d1fbc5bac1f6d98fd3\"", + "start": 0, "total_size": 0}'} + headers: + content-length: ['90'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/moderate_subs@example.com/requests + response: + body: {string: !!python/unicode '{"http_etag": "\"32223434a0f3af4cdc4673d1fbc5bac1f6d98fd3\"", + "start": 0, "total_size": 0}'} + headers: + content-length: ['90'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/domains + response: + body: {string: !!python/unicode '{"entries": [{"base_url": "http://example.com", + "description": null, "http_etag": "\"e736411818ff1815ca83575e0958c38c5188f0a4\"", + "mail_host": "example.com", "self_link": "http://localhost:9001/3.0/domains/example.com", + "url_host": "example.com"}], "http_etag": "\"c385b155f8da284bf78dbe075e20f58a30c893ab\"", + "start": 0, "total_size": 1}'} + headers: + content-length: ['338'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode DELETE + uri: http://localhost:9001/3.0/domains/example.com + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + status: {code: 204, message: No Content} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/users + response: + body: {string: !!python/unicode '{"entries": [{"created_on": "2005-08-01T07:49:23", + "http_etag": "\"63f8d56eaf2545a495a9b61acc47e2fa62697073\"", "is_server_owner": + false, "password": "$6$rounds=609031$uX4mXc7izwD/c7W.$TTI/uoqKq569Qi7qndf4JrjeVG.coAuyZy78NDZ/Qv4ZKWRGVHa/OVQghW8aJwAGmoKnbkrFcTd0LNkC9tJcG0", + "self_link": "http://localhost:9001/3.0/users/1", "user_id": 1}], "http_etag": + "\"41b392c9fb2816b7d69fe8146be0832a87b941a1\"", "start": 0, "total_size": + 1}'} + headers: + content-length: ['429'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode DELETE + uri: http://localhost:9001/3.0/users/1 + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + status: {code: 204, message: No Content} +version: 1 diff --git a/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_change_subscription_open.yaml b/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_change_subscription_open.yaml new file mode 100644 index 0000000..2c0ce0f --- /dev/null +++ b/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_change_subscription_open.yaml @@ -0,0 +1,688 @@ +interactions: +- request: + body: mail_host=example.com + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] + method: !!python/unicode POST + uri: http://localhost:9001/3.0/domains + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + location: ['http://localhost:9001/3.0/domains/example.com'] + status: {code: 201, message: Created} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/domains/example.com + response: + body: {string: !!python/unicode '{"base_url": "http://example.com", "description": + null, "http_etag": "\"e736411818ff1815ca83575e0958c38c5188f0a4\"", "mail_host": + "example.com", "self_link": "http://localhost:9001/3.0/domains/example.com", + "url_host": "example.com"}'} + headers: + content-length: ['233'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: fqdn_listname=open_list%40example.com + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] + method: !!python/unicode POST + uri: http://localhost:9001/3.0/lists + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + location: ['http://localhost:9001/3.0/lists/open_list.example.com'] + status: {code: 201, message: Created} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/open_list.example.com + response: + body: {string: !!python/unicode '{"display_name": "Open_list", "fqdn_listname": + "open_list@example.com", "http_etag": "\"6726e101e1dd1de6043eee72f741d4c2479f4735\"", + "list_id": "open_list.example.com", "list_name": "open_list", "mail_host": + "example.com", "member_count": 0, "self_link": "http://localhost:9001/3.0/lists/open_list.example.com", + "volume": 1}'} + headers: + content-length: ['324'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/open_list@example.com/config + response: + body: {string: !!python/unicode '{"acceptable_aliases": [], "admin_immed_notify": + true, "admin_notify_mchanges": false, "administrivia": true, "advertised": + true, "allow_list_posts": true, "anonymous_list": false, "archive_policy": + "public", "autorespond_owner": "none", "autorespond_postings": "none", "autorespond_requests": + "none", "autoresponse_grace_period": "90d", "autoresponse_owner_text": "", + "autoresponse_postings_text": "", "autoresponse_request_text": "", "bounces_address": + "open_list-bounces@example.com", "collapse_alternatives": true, "convert_html_to_plaintext": + false, "created_at": "2005-08-01T07:49:23", "default_member_action": "defer", + "default_nonmember_action": "hold", "description": "", "digest_last_sent_at": + null, "digest_send_periodic": true, "digest_size_threshold": 30.0, "digest_volume_frequency": + "monthly", "digests_enabled": true, "display_name": "Open_list", "filter_content": + false, "first_strip_reply_to": false, "fqdn_listname": "open_list@example.com", + "goodbye_message_uri": "", "http_etag": "\"3d16b6c6d1bb8fed130bd061c70a0894856a4ca8\"", + "include_rfc2369_headers": true, "join_address": "open_list-join@example.com", + "last_post_at": null, "leave_address": "open_list-leave@example.com", "list_name": + "open_list", "mail_host": "example.com", "next_digest_number": 1, "no_reply_address": + "noreply@example.com", "owner_address": "open_list-owner@example.com", "post_id": + 1, "posting_address": "open_list@example.com", "posting_pipeline": "default-posting-pipeline", + "reply_goes_to_list": "no_munging", "reply_to_address": "", "request_address": + "open_list-request@example.com", "scheme": "http", "send_welcome_message": + true, "subject_prefix": "[Open_list] ", "subscription_policy": "confirm", + "volume": 1, "web_host": "example.com", "welcome_message_uri": "mailman:///welcome.txt"}'} + headers: + content-length: ['1790'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: subscription_policy=open + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] + method: !!python/unicode PATCH + uri: http://localhost:9001/3.0/lists/open_list@example.com/config + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + status: {code: 204, message: No Content} +- request: + body: fqdn_listname=moderate_subs%40example.com + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] + method: !!python/unicode POST + uri: http://localhost:9001/3.0/lists + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + location: ['http://localhost:9001/3.0/lists/moderate_subs.example.com'] + status: {code: 201, message: Created} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/moderate_subs.example.com + response: + body: {string: !!python/unicode '{"display_name": "Moderate_subs", "fqdn_listname": + "moderate_subs@example.com", "http_etag": "\"4cf5a031a451ad84a54e4c708cacda8e676e617f\"", + "list_id": "moderate_subs.example.com", "list_name": "moderate_subs", "mail_host": + "example.com", "member_count": 0, "self_link": "http://localhost:9001/3.0/lists/moderate_subs.example.com", + "volume": 1}'} + headers: + content-length: ['344'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/moderate_subs@example.com/config + response: + body: {string: !!python/unicode '{"acceptable_aliases": [], "admin_immed_notify": + true, "admin_notify_mchanges": false, "administrivia": true, "advertised": + true, "allow_list_posts": true, "anonymous_list": false, "archive_policy": + "public", "autorespond_owner": "none", "autorespond_postings": "none", "autorespond_requests": + "none", "autoresponse_grace_period": "90d", "autoresponse_owner_text": "", + "autoresponse_postings_text": "", "autoresponse_request_text": "", "bounces_address": + "moderate_subs-bounces@example.com", "collapse_alternatives": true, "convert_html_to_plaintext": + false, "created_at": "2005-08-01T07:49:23", "default_member_action": "defer", + "default_nonmember_action": "hold", "description": "", "digest_last_sent_at": + null, "digest_send_periodic": true, "digest_size_threshold": 30.0, "digest_volume_frequency": + "monthly", "digests_enabled": true, "display_name": "Moderate_subs", "filter_content": + false, "first_strip_reply_to": false, "fqdn_listname": "moderate_subs@example.com", + "goodbye_message_uri": "", "http_etag": "\"bbeb372001a49a25fa038477abd59e8b3c45a20d\"", + "include_rfc2369_headers": true, "join_address": "moderate_subs-join@example.com", + "last_post_at": null, "leave_address": "moderate_subs-leave@example.com", + "list_name": "moderate_subs", "mail_host": "example.com", "next_digest_number": + 1, "no_reply_address": "noreply@example.com", "owner_address": "moderate_subs-owner@example.com", + "post_id": 1, "posting_address": "moderate_subs@example.com", "posting_pipeline": + "default-posting-pipeline", "reply_goes_to_list": "no_munging", "reply_to_address": + "", "request_address": "moderate_subs-request@example.com", "scheme": "http", + "send_welcome_message": true, "subject_prefix": "[Moderate_subs] ", "subscription_policy": + "confirm", "volume": 1, "web_host": "example.com", "welcome_message_uri": + "mailman:///welcome.txt"}'} + headers: + content-length: ['1830'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: subscription_policy=moderate + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] + method: !!python/unicode PATCH + uri: http://localhost:9001/3.0/lists/moderate_subs@example.com/config + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + status: {code: 204, message: No Content} +- request: + body: email=test%40example.com + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] + method: !!python/unicode POST + uri: http://localhost:9001/3.0/users + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + location: ['http://localhost:9001/3.0/users/2'] + status: {code: 201, message: Created} +- request: + body: email=fritz%40example.org + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] + method: !!python/unicode POST + uri: http://localhost:9001/3.0/users/2/addresses + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + location: ['http://localhost:9001/3.0/addresses/fritz@example.org'] + status: {code: 201, message: Created} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/users/2 + response: + body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": + "\"87f1d9e94ec320f33da1b3afd861a03a41760fef\"", "is_server_owner": false, + "password": "$6$rounds=625736$zrGjcUczGu9z3mmn$VtzxbzLToRfxA64YTFOBe3eUBmiJVKz1TzNz/seQ9zGkjMVMI1PBGj3e5CH4eZNefnsJCk35NK.1niCEJ87El1", + "self_link": "http://localhost:9001/3.0/users/2", "user_id": 2}'} + headers: + content-length: ['324'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/users/2/addresses + response: + body: {string: !!python/unicode '{"entries": [{"email": "fritz@example.org", "http_etag": + "\"59db728c101c90c441ba4147218eec848dbb39ac\"", "original_email": "fritz@example.org", + "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/fritz@example.org", + "user": "http://localhost:9001/3.0/users/2"}, {"email": "test@example.com", + "http_etag": "\"c89baf60a49c1e2acee73e8d6a417f43c5ba821d\"", "original_email": + "test@example.com", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/test@example.com", + "user": "http://localhost:9001/3.0/users/2"}], "http_etag": "\"14bd53954051b066b79d135f728b9a52b001a4fb\"", + "start": 0, "total_size": 2}'} + headers: + content-length: ['674'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode POST + uri: http://localhost:9001/3.0/addresses/fritz@example.org/verify + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + status: {code: 204, message: No Content} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode POST + uri: http://localhost:9001/3.0/addresses/test@example.com/verify + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + status: {code: 204, message: No Content} +- request: + body: display_name=None&list_id=open_list.example.com&subscriber=test%40example.com + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] + method: !!python/unicode POST + uri: http://localhost:9001/3.0/members + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + location: ['http://localhost:9001/3.0/members/3'] + status: {code: 201, message: Created} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/open_list@example.com/roster/member + response: + body: {string: !!python/unicode '{"entries": [{"address": "http://localhost:9001/3.0/addresses/test@example.com", + "delivery_mode": "regular", "email": "test@example.com", "http_etag": "\"476d4c8714b716ae8320fc4a9a927f33d0a07f7a\"", + "list_id": "open_list.example.com", "member_id": 3, "moderation_action": "defer", + "role": "member", "self_link": "http://localhost:9001/3.0/members/3", "user": + "http://localhost:9001/3.0/users/2"}], "http_etag": "\"021afa6aa4355016a2ae3f60a813e2faf6d16fd0\"", + "start": 0, "total_size": 1}'} + headers: + content-length: ['487'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/open_list@example.com/requests + response: + body: {string: !!python/unicode '{"http_etag": "\"32223434a0f3af4cdc4673d1fbc5bac1f6d98fd3\"", + "start": 0, "total_size": 0}'} + headers: + content-length: ['90'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/users/test@example.com + response: + body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": + "\"87f1d9e94ec320f33da1b3afd861a03a41760fef\"", "is_server_owner": false, + "password": "$6$rounds=625736$zrGjcUczGu9z3mmn$VtzxbzLToRfxA64YTFOBe3eUBmiJVKz1TzNz/seQ9zGkjMVMI1PBGj3e5CH4eZNefnsJCk35NK.1niCEJ87El1", + "self_link": "http://localhost:9001/3.0/users/2", "user_id": 2}'} + headers: + content-length: ['324'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/users/2/addresses + response: + body: {string: !!python/unicode '{"entries": [{"email": "fritz@example.org", "http_etag": + "\"02f89f7abae6a83149f8c4a5cf9d7c468e022f49\"", "original_email": "fritz@example.org", + "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/fritz@example.org", + "user": "http://localhost:9001/3.0/users/2", "verified_on": "2005-08-01T07:49:23"}, + {"email": "test@example.com", "http_etag": "\"085ffbadea6785f7de600c67e7950064bb040334\"", + "original_email": "test@example.com", "registered_on": "2005-08-01T07:49:23", + "self_link": "http://localhost:9001/3.0/addresses/test@example.com", "user": + "http://localhost:9001/3.0/users/2", "verified_on": "2005-08-01T07:49:23"}], + "http_etag": "\"301824ea931101a0141bd2423dda3aff89284144\"", "start": 0, "total_size": + 2}'} + headers: + content-length: ['750'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/open_list.example.com + response: + body: {string: !!python/unicode '{"display_name": "Open_list", "fqdn_listname": + "open_list@example.com", "http_etag": "\"f19d0b7ddb1b51b8c81a873365571fd6aeb6162d\"", + "list_id": "open_list.example.com", "list_name": "open_list", "mail_host": + "example.com", "member_count": 1, "self_link": "http://localhost:9001/3.0/lists/open_list.example.com", + "volume": 1}'} + headers: + content-length: ['324'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/open_list.example.com/roster/owner + response: + body: {string: !!python/unicode '{"http_etag": "\"32223434a0f3af4cdc4673d1fbc5bac1f6d98fd3\"", + "start": 0, "total_size": 0}'} + headers: + content-length: ['90'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/open_list.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] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/open_list.example.com/member/test@example.com + response: + body: {string: !!python/unicode '{"address": "http://localhost:9001/3.0/addresses/test@example.com", + "delivery_mode": "regular", "email": "test@example.com", "http_etag": "\"476d4c8714b716ae8320fc4a9a927f33d0a07f7a\"", + "list_id": "open_list.example.com", "member_id": 3, "moderation_action": "defer", + "role": "member", "self_link": "http://localhost:9001/3.0/members/3", "user": + "http://localhost:9001/3.0/users/2"}'} + headers: + content-length: ['382'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode DELETE + uri: http://localhost:9001/3.0/lists/open_list.example.com/member/test@example.com + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + status: {code: 204, message: No Content} +- request: + body: display_name=None&list_id=open_list.example.com&pre_confirmed=True&subscriber=fritz%40example.org + headers: + accept-encoding: ['gzip, deflate'] + !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] + method: !!python/unicode POST + uri: http://localhost:9001/3.0/members + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + location: ['http://localhost:9001/3.0/members/4'] + status: {code: 201, message: Created} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/open_list@example.com/roster/member + response: + body: {string: !!python/unicode '{"entries": [{"address": "http://localhost:9001/3.0/addresses/fritz@example.org", + "delivery_mode": "regular", "email": "fritz@example.org", "http_etag": "\"35f074a3676253b609aff72ddc0b8d5a2d806165\"", + "list_id": "open_list.example.com", "member_id": 4, "moderation_action": "defer", + "role": "member", "self_link": "http://localhost:9001/3.0/members/4", "user": + "http://localhost:9001/3.0/users/2"}], "http_etag": "\"8e7eaaa9e56b62edecd22999859164584e7b58cb\"", + "start": 0, "total_size": 1}'} + headers: + content-length: ['489'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/open_list@example.com/requests + response: + body: {string: !!python/unicode '{"http_etag": "\"32223434a0f3af4cdc4673d1fbc5bac1f6d98fd3\"", + "start": 0, "total_size": 0}'} + headers: + content-length: ['90'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/open_list.example.com/member/fritz@example.org + response: + body: {string: !!python/unicode '{"address": "http://localhost:9001/3.0/addresses/fritz@example.org", + "delivery_mode": "regular", "email": "fritz@example.org", "http_etag": "\"35f074a3676253b609aff72ddc0b8d5a2d806165\"", + "list_id": "open_list.example.com", "member_id": 4, "moderation_action": "defer", + "role": "member", "self_link": "http://localhost:9001/3.0/members/4", "user": + "http://localhost:9001/3.0/users/2"}'} + headers: + content-length: ['384'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/users/test@example.com + response: + body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": + "\"87f1d9e94ec320f33da1b3afd861a03a41760fef\"", "is_server_owner": false, + "password": "$6$rounds=625736$zrGjcUczGu9z3mmn$VtzxbzLToRfxA64YTFOBe3eUBmiJVKz1TzNz/seQ9zGkjMVMI1PBGj3e5CH4eZNefnsJCk35NK.1niCEJ87El1", + "self_link": "http://localhost:9001/3.0/users/2", "user_id": 2}'} + headers: + content-length: ['324'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/users/2/addresses + response: + body: {string: !!python/unicode '{"entries": [{"email": "fritz@example.org", "http_etag": + "\"02f89f7abae6a83149f8c4a5cf9d7c468e022f49\"", "original_email": "fritz@example.org", + "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/fritz@example.org", + "user": "http://localhost:9001/3.0/users/2", "verified_on": "2005-08-01T07:49:23"}, + {"email": "test@example.com", "http_etag": "\"085ffbadea6785f7de600c67e7950064bb040334\"", + "original_email": "test@example.com", "registered_on": "2005-08-01T07:49:23", + "self_link": "http://localhost:9001/3.0/addresses/test@example.com", "user": + "http://localhost:9001/3.0/users/2", "verified_on": "2005-08-01T07:49:23"}], + "http_etag": "\"301824ea931101a0141bd2423dda3aff89284144\"", "start": 0, "total_size": + 2}'} + headers: + content-length: ['750'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/open_list.example.com + response: + body: {string: !!python/unicode '{"display_name": "Open_list", "fqdn_listname": + "open_list@example.com", "http_etag": "\"f19d0b7ddb1b51b8c81a873365571fd6aeb6162d\"", + "list_id": "open_list.example.com", "list_name": "open_list", "mail_host": + "example.com", "member_count": 1, "self_link": "http://localhost:9001/3.0/lists/open_list.example.com", + "volume": 1}'} + headers: + content-length: ['324'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/open_list.example.com/roster/owner + response: + body: {string: !!python/unicode '{"http_etag": "\"32223434a0f3af4cdc4673d1fbc5bac1f6d98fd3\"", + "start": 0, "total_size": 0}'} + headers: + content-length: ['90'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/open_list.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] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/open_list.example.com/member/test@example.com + response: + body: {string: !!python/unicode '{}'} + headers: + content-length: ['2'] + content-type: [application/json] + status: {code: 404, message: Not Found} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/open_list.example.com/member/fritz@example.org + response: + body: {string: !!python/unicode '{"address": "http://localhost:9001/3.0/addresses/fritz@example.org", + "delivery_mode": "regular", "email": "fritz@example.org", "http_etag": "\"35f074a3676253b609aff72ddc0b8d5a2d806165\"", + "list_id": "open_list.example.com", "member_id": 4, "moderation_action": "defer", + "role": "member", "self_link": "http://localhost:9001/3.0/members/4", "user": + "http://localhost:9001/3.0/users/2"}'} + headers: + content-length: ['384'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/open_list@example.com/config + response: + body: {string: !!python/unicode '{"acceptable_aliases": [], "admin_immed_notify": + true, "admin_notify_mchanges": false, "administrivia": true, "advertised": + true, "allow_list_posts": true, "anonymous_list": false, "archive_policy": + "public", "autorespond_owner": "none", "autorespond_postings": "none", "autorespond_requests": + "none", "autoresponse_grace_period": "90d", "autoresponse_owner_text": "", + "autoresponse_postings_text": "", "autoresponse_request_text": "", "bounces_address": + "open_list-bounces@example.com", "collapse_alternatives": true, "convert_html_to_plaintext": + false, "created_at": "2005-08-01T07:49:23", "default_member_action": "defer", + "default_nonmember_action": "hold", "description": "", "digest_last_sent_at": + null, "digest_send_periodic": true, "digest_size_threshold": 30.0, "digest_volume_frequency": + "monthly", "digests_enabled": true, "display_name": "Open_list", "filter_content": + false, "first_strip_reply_to": false, "fqdn_listname": "open_list@example.com", + "goodbye_message_uri": "", "http_etag": "\"f5522fcc64a0848ce01fcad0b5f9ee42b9c02bd3\"", + "include_rfc2369_headers": true, "join_address": "open_list-join@example.com", + "last_post_at": null, "leave_address": "open_list-leave@example.com", "list_name": + "open_list", "mail_host": "example.com", "next_digest_number": 1, "no_reply_address": + "noreply@example.com", "owner_address": "open_list-owner@example.com", "post_id": + 1, "posting_address": "open_list@example.com", "posting_pipeline": "default-posting-pipeline", + "reply_goes_to_list": "no_munging", "reply_to_address": "", "request_address": + "open_list-request@example.com", "scheme": "http", "send_welcome_message": + true, "subject_prefix": "[Open_list] ", "subscription_policy": "open", "volume": + 1, "web_host": "example.com", "welcome_message_uri": "mailman:///welcome.txt"}'} + headers: + content-length: ['1787'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/open_list@example.com/requests + response: + body: {string: !!python/unicode '{"http_etag": "\"32223434a0f3af4cdc4673d1fbc5bac1f6d98fd3\"", + "start": 0, "total_size": 0}'} + headers: + content-length: ['90'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/lists/moderate_subs@example.com/requests + response: + body: {string: !!python/unicode '{"http_etag": "\"32223434a0f3af4cdc4673d1fbc5bac1f6d98fd3\"", + "start": 0, "total_size": 0}'} + headers: + content-length: ['90'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/domains + response: + body: {string: !!python/unicode '{"entries": [{"base_url": "http://example.com", + "description": null, "http_etag": "\"e736411818ff1815ca83575e0958c38c5188f0a4\"", + "mail_host": "example.com", "self_link": "http://localhost:9001/3.0/domains/example.com", + "url_host": "example.com"}], "http_etag": "\"c385b155f8da284bf78dbe075e20f58a30c893ab\"", + "start": 0, "total_size": 1}'} + headers: + content-length: ['338'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode DELETE + uri: http://localhost:9001/3.0/domains/example.com + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + status: {code: 204, message: No Content} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/users + response: + body: {string: !!python/unicode '{"entries": [{"created_on": "2005-08-01T07:49:23", + "http_etag": "\"87f1d9e94ec320f33da1b3afd861a03a41760fef\"", "is_server_owner": + false, "password": "$6$rounds=625736$zrGjcUczGu9z3mmn$VtzxbzLToRfxA64YTFOBe3eUBmiJVKz1TzNz/seQ9zGkjMVMI1PBGj3e5CH4eZNefnsJCk35NK.1niCEJ87El1", + "self_link": "http://localhost:9001/3.0/users/2", "user_id": 2}], "http_etag": + "\"b56bc3aed48a0b23a533223fbcbd05134633d17f\"", "start": 0, "total_size": + 1}'} + headers: + content-length: ['429'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode DELETE + uri: http://localhost:9001/3.0/users/2 + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + status: {code: 204, message: No Content} +version: 1 diff --git a/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_mass_subscribe.yaml b/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_mass_subscribe.yaml index a114772..752b525 100644 --- a/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_mass_subscribe.yaml +++ b/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_mass_subscribe.yaml @@ -187,7 +187,7 @@ body: {string: !!python/unicode ''} headers: content-length: ['0'] - location: ['http://localhost:9001/3.0/users/116'] + location: ['http://localhost:9001/3.0/users/3'] status: {code: 201, message: Created} - request: body: email=fritz%40example.org @@ -195,7 +195,7 @@ accept-encoding: ['gzip, deflate'] !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] method: !!python/unicode POST - uri: http://localhost:9001/3.0/users/116/addresses + uri: http://localhost:9001/3.0/users/3/addresses response: body: {string: !!python/unicode ''} headers: @@ -206,6 +206,40 @@ body: null headers: accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/users/3 + response: + body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": + "\"b098e212436e9603c36a2c3e536afb238d84024e\"", "is_server_owner": false, + "password": "$6$rounds=701485$u01sS1ACWnQVtLnq$tsdRAMaQ18E9XPPEw6FcTBj9gum1oPBGYjUQug8GOgM//FcQOKVMz1drlUe08wuettxH3jw9rldgThWiTIn500", + "self_link": "http://localhost:9001/3.0/users/3", "user_id": 3}'} + headers: + content-length: ['324'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/users/3/addresses + response: + body: {string: !!python/unicode '{"entries": [{"email": "fritz@example.org", "http_etag": + "\"4acba92c10f9469faebaae91b3b918d8c4955fdc\"", "original_email": "fritz@example.org", + "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/fritz@example.org", + "user": "http://localhost:9001/3.0/users/3"}, {"email": "test@example.com", + "http_etag": "\"bec867729ea260d4f901a156496a3122cea4c457\"", "original_email": + "test@example.com", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/test@example.com", + "user": "http://localhost:9001/3.0/users/3"}], "http_etag": "\"ddc541a92620b0aedffb9866ab3d7688fbaf29e9\"", + "start": 0, "total_size": 2}'} + headers: + content-length: ['674'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] method: !!python/unicode POST uri: http://localhost:9001/3.0/addresses/fritz@example.org/verify response: @@ -214,6 +248,17 @@ content-length: ['0'] status: {code: 204, message: No Content} - request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode POST + uri: http://localhost:9001/3.0/addresses/test@example.com/verify + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + status: {code: 204, message: No Content} +- request: body: list_id=open_list.example.com&role=owner&subscriber=owner%40example.com headers: accept-encoding: ['gzip, deflate'] @@ -224,7 +269,7 @@ body: {string: !!python/unicode ''} headers: content-length: ['0'] - location: ['http://localhost:9001/3.0/members/102'] + location: ['http://localhost:9001/3.0/members/5'] status: {code: 201, message: Created} - request: body: null @@ -234,10 +279,10 @@ uri: http://localhost:9001/3.0/users/owner@example.com response: body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": - "\"d87649f27b1fac7ffd78a81e3665ac8ed67c18a1\"", "is_server_owner": false, - "self_link": "http://localhost:9001/3.0/users/117", "user_id": 117}'} + "\"c1dcbf16536eb2e2151441f4bce2989ab1dab30b\"", "is_server_owner": false, + "self_link": "http://localhost:9001/3.0/users/4", "user_id": 4}'} headers: - content-length: ['192'] + content-length: ['188'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -245,15 +290,15 @@ headers: accept-encoding: ['gzip, deflate'] method: !!python/unicode GET - uri: http://localhost:9001/3.0/users/117/addresses + uri: http://localhost:9001/3.0/users/4/addresses response: body: {string: !!python/unicode '{"entries": [{"email": "owner@example.com", "http_etag": - "\"4a74dd95da7be7fd25be4fa36e8a107642b984e1\"", "original_email": "owner@example.com", + "\"1e841ce33417ddddf7c2759638da4b813404e4cf\"", "original_email": "owner@example.com", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/owner@example.com", - "user": "http://localhost:9001/3.0/users/117"}], "http_etag": "\"56f95715c4094007028818cf6551481697be492a\"", + "user": "http://localhost:9001/3.0/users/4"}], "http_etag": "\"55e06c27436f069b5f8a5c44c3d9e0c97b84b5ee\"", "start": 0, "total_size": 1}'} headers: - content-length: ['392'] + content-length: ['390'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -280,13 +325,13 @@ uri: http://localhost:9001/3.0/lists/open_list.example.com/roster/owner response: body: {string: !!python/unicode '{"entries": [{"address": "http://localhost:9001/3.0/addresses/owner@example.com", - "delivery_mode": "regular", "email": "owner@example.com", "http_etag": "\"31dd23429e97f811eadd1da51c4a40cd24ba3620\"", - "list_id": "open_list.example.com", "member_id": 102, "moderation_action": - "accept", "role": "owner", "self_link": "http://localhost:9001/3.0/members/102", - "user": "http://localhost:9001/3.0/users/117"}], "http_etag": "\"526adddb41f77b50169f14b2dfc9ec994c13359d\"", + "delivery_mode": "regular", "email": "owner@example.com", "http_etag": "\"49eb2113bbe8e2b2adceb819ec761224df7e8ff1\"", + "list_id": "open_list.example.com", "member_id": 5, "moderation_action": "accept", + "role": "owner", "self_link": "http://localhost:9001/3.0/members/5", "user": + "http://localhost:9001/3.0/users/4"}], "http_etag": "\"9e4ef5b93c74bcd28b02c7be63ffc8cf1acbd416\"", "start": 0, "total_size": 1}'} headers: - content-length: ['495'] + content-length: ['489'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -329,7 +374,7 @@ body: {string: !!python/unicode ''} headers: content-length: ['0'] - location: ['http://localhost:9001/3.0/members/103'] + location: ['http://localhost:9001/3.0/members/6'] status: {code: 201, message: Created} - request: body: display_name=None&list_id=open_list.example.com&pre_approved=True&pre_confirmed=True&pre_verified=True&subscriber=kane%40example.org @@ -342,7 +387,7 @@ body: {string: !!python/unicode ''} headers: content-length: ['0'] - location: ['http://localhost:9001/3.0/members/104'] + location: ['http://localhost:9001/3.0/members/7'] status: {code: 201, message: Created} - request: body: display_name=None&list_id=open_list.example.com&pre_approved=True&pre_confirmed=True&pre_verified=True&subscriber=abel%40example.org @@ -355,7 +400,7 @@ body: {string: !!python/unicode ''} headers: content-length: ['0'] - location: ['http://localhost:9001/3.0/members/105'] + location: ['http://localhost:9001/3.0/members/8'] status: {code: 201, message: Created} - request: body: null @@ -365,21 +410,21 @@ uri: http://localhost:9001/3.0/lists/open_list@example.com/roster/member response: body: {string: !!python/unicode '{"entries": [{"address": "http://localhost:9001/3.0/addresses/abel@example.org", - "delivery_mode": "regular", "email": "abel@example.org", "http_etag": "\"a825cc5d667859eecb93e79e19e6980737aade08\"", - "list_id": "open_list.example.com", "member_id": 105, "role": "member", "self_link": - "http://localhost:9001/3.0/members/105", "user": "http://localhost:9001/3.0/users/119"}, - {"address": "http://localhost:9001/3.0/addresses/fritz@example.org", "delivery_mode": - "regular", "email": "fritz@example.org", "http_etag": "\"6f4927c6ce43fdc71b28f7d827d3fc56c2c9d3d1\"", - "list_id": "open_list.example.com", "member_id": 103, "role": "member", "self_link": - "http://localhost:9001/3.0/members/103", "user": "http://localhost:9001/3.0/users/116"}, - {"address": "http://localhost:9001/3.0/addresses/kane@example.org", "delivery_mode": - "regular", "email": "kane@example.org", "http_etag": "\"50d0dda902a59afa476aeb81dc3c94713136eb14\"", - "list_id": "open_list.example.com", "member_id": 104, "role": "member", "self_link": - "http://localhost:9001/3.0/members/104", "user": "http://localhost:9001/3.0/users/118"}], - "http_etag": "\"958d2083039cdc2734d0af2e45de8e738a383b07\"", "start": 0, "total_size": - 3}'} + "delivery_mode": "regular", "email": "abel@example.org", "http_etag": "\"fd6b64d2f91c4322ccff28c08b05c8bf7757a71f\"", + "list_id": "open_list.example.com", "member_id": 8, "moderation_action": "defer", + "role": "member", "self_link": "http://localhost:9001/3.0/members/8", "user": + "http://localhost:9001/3.0/users/6"}, {"address": "http://localhost:9001/3.0/addresses/fritz@example.org", + "delivery_mode": "regular", "email": "fritz@example.org", "http_etag": "\"4efb85e3a52b4ba559d5704b8aeb42339415fe6e\"", + "list_id": "open_list.example.com", "member_id": 6, "moderation_action": "defer", + "role": "member", "self_link": "http://localhost:9001/3.0/members/6", "user": + "http://localhost:9001/3.0/users/3"}, {"address": "http://localhost:9001/3.0/addresses/kane@example.org", + "delivery_mode": "regular", "email": "kane@example.org", "http_etag": "\"0fbd1e304a840ba3f64785516465a4c8f12ec085\"", + "list_id": "open_list.example.com", "member_id": 7, "moderation_action": "defer", + "role": "member", "self_link": "http://localhost:9001/3.0/members/7", "user": + "http://localhost:9001/3.0/users/5"}], "http_etag": "\"4028fd77c4a4387296c55307d1a339d552a6c097\"", + "start": 0, "total_size": 3}'} headers: - content-length: ['1185'] + content-length: ['1257'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -443,21 +488,20 @@ uri: http://localhost:9001/3.0/users response: body: {string: !!python/unicode '{"entries": [{"created_on": "2005-08-01T07:49:23", - "http_etag": "\"7054947398d22d30c663dd88c246cc386f7cf4a2\"", "is_server_owner": - false, "password": "$6$rounds=687047$tX2PoFb7qjC1/gVT$/tQ1tXgmDZOYvtB57yKdzp7JSaqizhLE1KGRDdse004dhs4WiAJusE5ZaSRySrc/FOc1OwYzdLi7/YWDt6mfp/", - "self_link": "http://localhost:9001/3.0/users/116", "user_id": 116}, {"created_on": - "2005-08-01T07:49:23", "http_etag": "\"d87649f27b1fac7ffd78a81e3665ac8ed67c18a1\"", - "is_server_owner": false, "self_link": "http://localhost:9001/3.0/users/117", - "user_id": 117}, {"created_on": "2005-08-01T07:49:23", "display_name": "None", - "http_etag": "\"dbc5e6ae3e2e8a49b5a0bb69fabb6c9a0e1592be\"", "is_server_owner": - false, "self_link": "http://localhost:9001/3.0/users/118", "user_id": 118}, - {"created_on": "2005-08-01T07:49:23", "display_name": "None", "http_etag": - "\"c0b7290b786d2a0fa18d8e1f45328ad867b1f2e6\"", "is_server_owner": false, - "self_link": "http://localhost:9001/3.0/users/119", "user_id": 119}], "http_etag": - "\"1dbbdf5234cbf90e58e4c65e1606104cff309cc8\"", "start": 0, "total_size": - 4}'} + "http_etag": "\"b098e212436e9603c36a2c3e536afb238d84024e\"", "is_server_owner": + false, "password": "$6$rounds=701485$u01sS1ACWnQVtLnq$tsdRAMaQ18E9XPPEw6FcTBj9gum1oPBGYjUQug8GOgM//FcQOKVMz1drlUe08wuettxH3jw9rldgThWiTIn500", + "self_link": "http://localhost:9001/3.0/users/3", "user_id": 3}, {"created_on": + "2005-08-01T07:49:23", "http_etag": "\"c1dcbf16536eb2e2151441f4bce2989ab1dab30b\"", + "is_server_owner": false, "self_link": "http://localhost:9001/3.0/users/4", + "user_id": 4}, {"created_on": "2005-08-01T07:49:23", "display_name": "None", + "http_etag": "\"d2f85fa2e5dc69b6394e1f61679c379c84b50f6f\"", "is_server_owner": + false, "self_link": "http://localhost:9001/3.0/users/5", "user_id": 5}, {"created_on": + "2005-08-01T07:49:23", "display_name": "None", "http_etag": "\"2cd4496cdf38556bd2872fe98e1902fe60b452ed\"", + "is_server_owner": false, "self_link": "http://localhost:9001/3.0/users/6", + "user_id": 6}], "http_etag": "\"be7869efb83edfa9e1451d756cda78c417006625\"", + "start": 0, "total_size": 4}'} headers: - content-length: ['1063'] + content-length: ['1047'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -465,7 +509,7 @@ headers: accept-encoding: ['gzip, deflate'] method: !!python/unicode DELETE - uri: http://localhost:9001/3.0/users/116 + uri: http://localhost:9001/3.0/users/3 response: body: {string: !!python/unicode ''} headers: @@ -476,7 +520,7 @@ headers: accept-encoding: ['gzip, deflate'] method: !!python/unicode DELETE - uri: http://localhost:9001/3.0/users/117 + uri: http://localhost:9001/3.0/users/4 response: body: {string: !!python/unicode ''} headers: @@ -487,7 +531,7 @@ headers: accept-encoding: ['gzip, deflate'] method: !!python/unicode DELETE - uri: http://localhost:9001/3.0/users/118 + uri: http://localhost:9001/3.0/users/5 response: body: {string: !!python/unicode ''} headers: @@ -498,7 +542,7 @@ headers: accept-encoding: ['gzip, deflate'] method: !!python/unicode DELETE - uri: http://localhost:9001/3.0/users/119 + uri: http://localhost:9001/3.0/users/6 response: body: {string: !!python/unicode ''} headers: diff --git a/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_secondary_mod.yaml b/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_secondary_mod.yaml index 23532df..b7129b9 100644 --- a/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_secondary_mod.yaml +++ b/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_secondary_mod.yaml @@ -187,7 +187,7 @@ body: {string: !!python/unicode ''} headers: content-length: ['0'] - location: ['http://localhost:9001/3.0/users/120'] + location: ['http://localhost:9001/3.0/users/7'] status: {code: 201, message: Created} - request: body: email=fritz%40example.org @@ -195,7 +195,7 @@ accept-encoding: ['gzip, deflate'] !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] method: !!python/unicode POST - uri: http://localhost:9001/3.0/users/120/addresses + uri: http://localhost:9001/3.0/users/7/addresses response: body: {string: !!python/unicode ''} headers: @@ -206,6 +206,40 @@ body: null headers: accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/users/7 + response: + body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": + "\"6d1547199b1e24ceeada29d5846223466648e11a\"", "is_server_owner": false, + "password": "$6$rounds=719572$3abEW8q7vcDGW1V.$ER8LadISyD.z2TVPVrsLwvybCnzATMWjn4mXotm0699euEZnEWYBgX5U.ltxZTUBu5KCQEYSzemB3HOND647j1", + "self_link": "http://localhost:9001/3.0/users/7", "user_id": 7}'} + headers: + content-length: ['324'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/users/7/addresses + response: + body: {string: !!python/unicode '{"entries": [{"email": "fritz@example.org", "http_etag": + "\"490365930d4f0666d685bb7ebf5611974f53e017\"", "original_email": "fritz@example.org", + "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/fritz@example.org", + "user": "http://localhost:9001/3.0/users/7"}, {"email": "test@example.com", + "http_etag": "\"deab7596aa4fed8d7db92cd9fc477a4e0fa412f6\"", "original_email": + "test@example.com", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/test@example.com", + "user": "http://localhost:9001/3.0/users/7"}], "http_etag": "\"3cef8e3cfe66593a7f6f0fa7d71387ef89fcf836\"", + "start": 0, "total_size": 2}'} + headers: + content-length: ['674'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] method: !!python/unicode POST uri: http://localhost:9001/3.0/addresses/fritz@example.org/verify response: @@ -217,15 +251,26 @@ body: null headers: accept-encoding: ['gzip, deflate'] + method: !!python/unicode POST + uri: http://localhost:9001/3.0/addresses/test@example.com/verify + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + status: {code: 204, message: No Content} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] method: !!python/unicode GET uri: http://localhost:9001/3.0/users/test@example.com response: body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": - "\"f86cc8f4668c8cb7205d96054101b8b55d8a34af\"", "is_server_owner": false, - "password": "$6$rounds=698743$0mNF8cbyGN9MTjLd$l5iJNNgk87QdIy5AMd9.RUHGOqmTiqqptQh300YaSQmntYfU/0kaNpr.HzGk4VRjVb4q7RBfiv8CGZQS9A9Yo0", - "self_link": "http://localhost:9001/3.0/users/120", "user_id": 120}'} + "\"6d1547199b1e24ceeada29d5846223466648e11a\"", "is_server_owner": false, + "password": "$6$rounds=719572$3abEW8q7vcDGW1V.$ER8LadISyD.z2TVPVrsLwvybCnzATMWjn4mXotm0699euEZnEWYBgX5U.ltxZTUBu5KCQEYSzemB3HOND647j1", + "self_link": "http://localhost:9001/3.0/users/7", "user_id": 7}'} headers: - content-length: ['328'] + content-length: ['324'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -233,19 +278,20 @@ headers: accept-encoding: ['gzip, deflate'] method: !!python/unicode GET - uri: http://localhost:9001/3.0/users/120/addresses + uri: http://localhost:9001/3.0/users/7/addresses response: body: {string: !!python/unicode '{"entries": [{"email": "fritz@example.org", "http_etag": - "\"079578d46403c4c04c72e3adc6e3ac033bbc0ffd\"", "original_email": "fritz@example.org", + "\"544d5d4924c00a67b82f8d7cddaa5d2ccfd25bb9\"", "original_email": "fritz@example.org", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/fritz@example.org", - "user": "http://localhost:9001/3.0/users/120", "verified_on": "2005-08-01T07:49:23"}, - {"email": "test@example.com", "http_etag": "\"e52deb688dc78468309d52e3e835f06f9c8c1b58\"", + "user": "http://localhost:9001/3.0/users/7", "verified_on": "2005-08-01T07:49:23"}, + {"email": "test@example.com", "http_etag": "\"61b7b0e8ffc236d34de50c013b09c99eb7ee6f64\"", "original_email": "test@example.com", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/test@example.com", "user": - "http://localhost:9001/3.0/users/120"}], "http_etag": "\"3331330ec07f916a8c07c688c3712b4372ed9b87\"", - "start": 0, "total_size": 2}'} + "http://localhost:9001/3.0/users/7", "verified_on": "2005-08-01T07:49:23"}], + "http_etag": "\"cd7965a44a60e1c43b736a4c2bf90265059a6283\"", "start": 0, "total_size": + 2}'} headers: - content-length: ['716'] + content-length: ['750'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -298,8 +344,8 @@ method: !!python/unicode POST uri: http://localhost:9001/3.0/members response: - body: {string: !!python/unicode '{"http_etag": "\"fbcd5c8df6304a514d4bfa0b753b54857674d8dc\"", - "token": "0000000000000000000000000000000000000002", "token_owner": "moderator"}'} + body: {string: !!python/unicode '{"http_etag": "\"8171955e8578477ccef9f84470dd4b8e2ebb3615\"", + "token": "0000000000000000000000000000000000000001", "token_owner": "moderator"}'} headers: content-length: ['142'] content-type: [application/json; charset=utf-8] @@ -325,9 +371,9 @@ uri: http://localhost:9001/3.0/lists/moderate_subs@example.com/requests response: body: {string: !!python/unicode '{"entries": [{"display_name": "", "email": "fritz@example.org", - "http_etag": "\"6d5e1c84b0e79499b8a33d561983e3778e2b418a\"", "list_id": "moderate_subs.example.com", - "token": "0000000000000000000000000000000000000002", "token_owner": "moderator", - "type": "subscription", "when": "2005-08-01T07:49:23"}], "http_etag": "\"f2a2e0e65e2a94d4ccd96ac44098c4c88608a68a\"", + "http_etag": "\"0a5237c00a56ab2533d399fa5a37c3884abc218d\"", "list_id": "moderate_subs.example.com", + "token": "0000000000000000000000000000000000000001", "token_owner": "moderator", + "type": "subscription", "when": "2005-08-01T07:49:23"}], "http_etag": "\"30a9bf89320eecadf5775a0d1f41fdb9c92adc40\"", "start": 0, "total_size": 1}'} headers: content-length: ['392'] @@ -341,11 +387,11 @@ uri: http://localhost:9001/3.0/users/test@example.com response: body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": - "\"f86cc8f4668c8cb7205d96054101b8b55d8a34af\"", "is_server_owner": false, - "password": "$6$rounds=698743$0mNF8cbyGN9MTjLd$l5iJNNgk87QdIy5AMd9.RUHGOqmTiqqptQh300YaSQmntYfU/0kaNpr.HzGk4VRjVb4q7RBfiv8CGZQS9A9Yo0", - "self_link": "http://localhost:9001/3.0/users/120", "user_id": 120}'} + "\"6d1547199b1e24ceeada29d5846223466648e11a\"", "is_server_owner": false, + "password": "$6$rounds=719572$3abEW8q7vcDGW1V.$ER8LadISyD.z2TVPVrsLwvybCnzATMWjn4mXotm0699euEZnEWYBgX5U.ltxZTUBu5KCQEYSzemB3HOND647j1", + "self_link": "http://localhost:9001/3.0/users/7", "user_id": 7}'} headers: - content-length: ['328'] + content-length: ['324'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -353,19 +399,20 @@ headers: accept-encoding: ['gzip, deflate'] method: !!python/unicode GET - uri: http://localhost:9001/3.0/users/120/addresses + uri: http://localhost:9001/3.0/users/7/addresses response: body: {string: !!python/unicode '{"entries": [{"email": "fritz@example.org", "http_etag": - "\"079578d46403c4c04c72e3adc6e3ac033bbc0ffd\"", "original_email": "fritz@example.org", + "\"544d5d4924c00a67b82f8d7cddaa5d2ccfd25bb9\"", "original_email": "fritz@example.org", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/fritz@example.org", - "user": "http://localhost:9001/3.0/users/120", "verified_on": "2005-08-01T07:49:23"}, - {"email": "test@example.com", "http_etag": "\"e52deb688dc78468309d52e3e835f06f9c8c1b58\"", + "user": "http://localhost:9001/3.0/users/7", "verified_on": "2005-08-01T07:49:23"}, + {"email": "test@example.com", "http_etag": "\"61b7b0e8ffc236d34de50c013b09c99eb7ee6f64\"", "original_email": "test@example.com", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/test@example.com", "user": - "http://localhost:9001/3.0/users/120"}], "http_etag": "\"3331330ec07f916a8c07c688c3712b4372ed9b87\"", - "start": 0, "total_size": 2}'} + "http://localhost:9001/3.0/users/7", "verified_on": "2005-08-01T07:49:23"}], + "http_etag": "\"cd7965a44a60e1c43b736a4c2bf90265059a6283\"", "start": 0, "total_size": + 2}'} headers: - content-length: ['716'] + content-length: ['750'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -489,9 +536,9 @@ uri: http://localhost:9001/3.0/lists/moderate_subs@example.com/requests response: body: {string: !!python/unicode '{"entries": [{"display_name": "", "email": "fritz@example.org", - "http_etag": "\"6d5e1c84b0e79499b8a33d561983e3778e2b418a\"", "list_id": "moderate_subs.example.com", - "token": "0000000000000000000000000000000000000002", "token_owner": "moderator", - "type": "subscription", "when": "2005-08-01T07:49:23"}], "http_etag": "\"f2a2e0e65e2a94d4ccd96ac44098c4c88608a68a\"", + "http_etag": "\"0a5237c00a56ab2533d399fa5a37c3884abc218d\"", "list_id": "moderate_subs.example.com", + "token": "0000000000000000000000000000000000000001", "token_owner": "moderator", + "type": "subscription", "when": "2005-08-01T07:49:23"}], "http_etag": "\"30a9bf89320eecadf5775a0d1f41fdb9c92adc40\"", "start": 0, "total_size": 1}'} headers: content-length: ['392'] @@ -503,7 +550,7 @@ accept-encoding: ['gzip, deflate'] !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] method: !!python/unicode POST - uri: http://localhost:9001/3.0/lists/moderate_subs.example.com/requests/0000000000000000000000000000000000000002 + uri: http://localhost:9001/3.0/lists/moderate_subs.example.com/requests/0000000000000000000000000000000000000001 response: body: {string: !!python/unicode ''} headers: @@ -544,13 +591,13 @@ uri: http://localhost:9001/3.0/users response: body: {string: !!python/unicode '{"entries": [{"created_on": "2005-08-01T07:49:23", - "http_etag": "\"f86cc8f4668c8cb7205d96054101b8b55d8a34af\"", "is_server_owner": - false, "password": "$6$rounds=698743$0mNF8cbyGN9MTjLd$l5iJNNgk87QdIy5AMd9.RUHGOqmTiqqptQh300YaSQmntYfU/0kaNpr.HzGk4VRjVb4q7RBfiv8CGZQS9A9Yo0", - "self_link": "http://localhost:9001/3.0/users/120", "user_id": 120}], "http_etag": - "\"6011d350565ac72e6acfe9ee418105acadb02ea4\"", "start": 0, "total_size": + "http_etag": "\"6d1547199b1e24ceeada29d5846223466648e11a\"", "is_server_owner": + false, "password": "$6$rounds=719572$3abEW8q7vcDGW1V.$ER8LadISyD.z2TVPVrsLwvybCnzATMWjn4mXotm0699euEZnEWYBgX5U.ltxZTUBu5KCQEYSzemB3HOND647j1", + "self_link": "http://localhost:9001/3.0/users/7", "user_id": 7}], "http_etag": + "\"0bcfd7677c57d77f5054524cebf4cdfebc540be7\"", "start": 0, "total_size": 1}'} headers: - content-length: ['433'] + content-length: ['429'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -558,7 +605,7 @@ headers: accept-encoding: ['gzip, deflate'] method: !!python/unicode DELETE - uri: http://localhost:9001/3.0/users/120 + uri: http://localhost:9001/3.0/users/7 response: body: {string: !!python/unicode ''} headers: diff --git a/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_secondary_open.yaml b/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_secondary_open.yaml index 36a4005..a6cb3cf 100644 --- a/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_secondary_open.yaml +++ b/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_secondary_open.yaml @@ -187,7 +187,7 @@ body: {string: !!python/unicode ''} headers: content-length: ['0'] - location: ['http://localhost:9001/3.0/users/121'] + location: ['http://localhost:9001/3.0/users/8'] status: {code: 201, message: Created} - request: body: email=fritz%40example.org @@ -195,7 +195,7 @@ accept-encoding: ['gzip, deflate'] !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] method: !!python/unicode POST - uri: http://localhost:9001/3.0/users/121/addresses + uri: http://localhost:9001/3.0/users/8/addresses response: body: {string: !!python/unicode ''} headers: @@ -206,6 +206,40 @@ body: null headers: accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/users/8 + response: + body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": + "\"08f2542493d0aaaf751b60d97566fc444c747cd0\"", "is_server_owner": false, + "password": "$6$rounds=600893$NFsx42Q5cHXTSjHA$SonrSBbYGBjuS3J5pLQ4VLOvgFP8AyECkz/ZmyI9dmbiG9fL98/9wH6plsLMoiHZ1vdmN.kI.NUFO6ZUu.X2C1", + "self_link": "http://localhost:9001/3.0/users/8", "user_id": 8}'} + headers: + content-length: ['324'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/users/8/addresses + response: + body: {string: !!python/unicode '{"entries": [{"email": "fritz@example.org", "http_etag": + "\"3118a56631f161e15b05f860e8ef37464c89d18e\"", "original_email": "fritz@example.org", + "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/fritz@example.org", + "user": "http://localhost:9001/3.0/users/8"}, {"email": "test@example.com", + "http_etag": "\"ddda9833ea38cea61dbf611f3cf46fd118cba777\"", "original_email": + "test@example.com", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/test@example.com", + "user": "http://localhost:9001/3.0/users/8"}], "http_etag": "\"074af7e8657324171ae04b869b162467811b317b\"", + "start": 0, "total_size": 2}'} + headers: + content-length: ['674'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] method: !!python/unicode POST uri: http://localhost:9001/3.0/addresses/fritz@example.org/verify response: @@ -217,15 +251,26 @@ body: null headers: accept-encoding: ['gzip, deflate'] + method: !!python/unicode POST + uri: http://localhost:9001/3.0/addresses/test@example.com/verify + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + status: {code: 204, message: No Content} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] method: !!python/unicode GET uri: http://localhost:9001/3.0/users/test@example.com response: body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": - "\"da580436b3678aaf11186eefd19f1fd036d20bdb\"", "is_server_owner": false, - "password": "$6$rounds=652497$Ky7AXWjmBkJcW6N.$6eyXKmZLLFni0JpVgun3ziCaDVv00U79xwBCYelOdqkgcY1KvLkbqAf0TctDqYnZoZuAmblunGgsQjNiNU8aD.", - "self_link": "http://localhost:9001/3.0/users/121", "user_id": 121}'} + "\"08f2542493d0aaaf751b60d97566fc444c747cd0\"", "is_server_owner": false, + "password": "$6$rounds=600893$NFsx42Q5cHXTSjHA$SonrSBbYGBjuS3J5pLQ4VLOvgFP8AyECkz/ZmyI9dmbiG9fL98/9wH6plsLMoiHZ1vdmN.kI.NUFO6ZUu.X2C1", + "self_link": "http://localhost:9001/3.0/users/8", "user_id": 8}'} headers: - content-length: ['328'] + content-length: ['324'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -233,19 +278,20 @@ headers: accept-encoding: ['gzip, deflate'] method: !!python/unicode GET - uri: http://localhost:9001/3.0/users/121/addresses + uri: http://localhost:9001/3.0/users/8/addresses response: body: {string: !!python/unicode '{"entries": [{"email": "fritz@example.org", "http_etag": - "\"4eddc2721fc617b79298ac2621da296ee2add3cc\"", "original_email": "fritz@example.org", + "\"daa00b2c01031e3acab906927ca2edd5b5557399\"", "original_email": "fritz@example.org", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/fritz@example.org", - "user": "http://localhost:9001/3.0/users/121", "verified_on": "2005-08-01T07:49:23"}, - {"email": "test@example.com", "http_etag": "\"f8fbda30df77dec633f08addd3c5c95b5edd0fce\"", + "user": "http://localhost:9001/3.0/users/8", "verified_on": "2005-08-01T07:49:23"}, + {"email": "test@example.com", "http_etag": "\"9f73a0586e712ffb6e4a59c53090f38aba156bcb\"", "original_email": "test@example.com", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/test@example.com", "user": - "http://localhost:9001/3.0/users/121"}], "http_etag": "\"7483137d8d905a90e798883092c13a3560f697a3\"", - "start": 0, "total_size": 2}'} + "http://localhost:9001/3.0/users/8", "verified_on": "2005-08-01T07:49:23"}], + "http_etag": "\"0ef0000948f82250eb9d26b515749037d580cfca\"", "start": 0, "total_size": + 2}'} headers: - content-length: ['716'] + content-length: ['750'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -301,7 +347,7 @@ body: {string: !!python/unicode ''} headers: content-length: ['0'] - location: ['http://localhost:9001/3.0/members/106'] + location: ['http://localhost:9001/3.0/members/9'] status: {code: 201, message: Created} - request: body: null @@ -311,13 +357,13 @@ uri: http://localhost:9001/3.0/lists/open_list@example.com/roster/member response: body: {string: !!python/unicode '{"entries": [{"address": "http://localhost:9001/3.0/addresses/fritz@example.org", - "delivery_mode": "regular", "email": "fritz@example.org", "http_etag": "\"ddbc061cfd7b0a0d5f64379e5fa9a9cc492c1e09\"", - "list_id": "open_list.example.com", "member_id": 106, "role": "member", "self_link": - "http://localhost:9001/3.0/members/106", "user": "http://localhost:9001/3.0/users/121"}], - "http_etag": "\"cccc6f02d0be69c367f247a58151196654ee5908\"", "start": 0, "total_size": - 1}'} + "delivery_mode": "regular", "email": "fritz@example.org", "http_etag": "\"ed23be4a300928b2e4e39c7c6dc7e410d00f035f\"", + "list_id": "open_list.example.com", "member_id": 9, "moderation_action": "defer", + "role": "member", "self_link": "http://localhost:9001/3.0/members/9", "user": + "http://localhost:9001/3.0/users/8"}], "http_etag": "\"1e80fbe5a6f83dd6b4793f9923e612c5c4c29fba\"", + "start": 0, "total_size": 1}'} headers: - content-length: ['465'] + content-length: ['489'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -341,11 +387,11 @@ uri: http://localhost:9001/3.0/users/test@example.com response: body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": - "\"da580436b3678aaf11186eefd19f1fd036d20bdb\"", "is_server_owner": false, - "password": "$6$rounds=652497$Ky7AXWjmBkJcW6N.$6eyXKmZLLFni0JpVgun3ziCaDVv00U79xwBCYelOdqkgcY1KvLkbqAf0TctDqYnZoZuAmblunGgsQjNiNU8aD.", - "self_link": "http://localhost:9001/3.0/users/121", "user_id": 121}'} + "\"08f2542493d0aaaf751b60d97566fc444c747cd0\"", "is_server_owner": false, + "password": "$6$rounds=600893$NFsx42Q5cHXTSjHA$SonrSBbYGBjuS3J5pLQ4VLOvgFP8AyECkz/ZmyI9dmbiG9fL98/9wH6plsLMoiHZ1vdmN.kI.NUFO6ZUu.X2C1", + "self_link": "http://localhost:9001/3.0/users/8", "user_id": 8}'} headers: - content-length: ['328'] + content-length: ['324'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -353,19 +399,20 @@ headers: accept-encoding: ['gzip, deflate'] method: !!python/unicode GET - uri: http://localhost:9001/3.0/users/121/addresses + uri: http://localhost:9001/3.0/users/8/addresses response: body: {string: !!python/unicode '{"entries": [{"email": "fritz@example.org", "http_etag": - "\"4eddc2721fc617b79298ac2621da296ee2add3cc\"", "original_email": "fritz@example.org", + "\"daa00b2c01031e3acab906927ca2edd5b5557399\"", "original_email": "fritz@example.org", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/fritz@example.org", - "user": "http://localhost:9001/3.0/users/121", "verified_on": "2005-08-01T07:49:23"}, - {"email": "test@example.com", "http_etag": "\"f8fbda30df77dec633f08addd3c5c95b5edd0fce\"", + "user": "http://localhost:9001/3.0/users/8", "verified_on": "2005-08-01T07:49:23"}, + {"email": "test@example.com", "http_etag": "\"9f73a0586e712ffb6e4a59c53090f38aba156bcb\"", "original_email": "test@example.com", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/test@example.com", "user": - "http://localhost:9001/3.0/users/121"}], "http_etag": "\"7483137d8d905a90e798883092c13a3560f697a3\"", - "start": 0, "total_size": 2}'} + "http://localhost:9001/3.0/users/8", "verified_on": "2005-08-01T07:49:23"}], + "http_etag": "\"0ef0000948f82250eb9d26b515749037d580cfca\"", "start": 0, "total_size": + 2}'} headers: - content-length: ['716'] + content-length: ['750'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -430,11 +477,12 @@ uri: http://localhost:9001/3.0/lists/open_list.example.com/member/fritz@example.org response: body: {string: !!python/unicode '{"address": "http://localhost:9001/3.0/addresses/fritz@example.org", - "delivery_mode": "regular", "email": "fritz@example.org", "http_etag": "\"ddbc061cfd7b0a0d5f64379e5fa9a9cc492c1e09\"", - "list_id": "open_list.example.com", "member_id": 106, "role": "member", "self_link": - "http://localhost:9001/3.0/members/106", "user": "http://localhost:9001/3.0/users/121"}'} + "delivery_mode": "regular", "email": "fritz@example.org", "http_etag": "\"ed23be4a300928b2e4e39c7c6dc7e410d00f035f\"", + "list_id": "open_list.example.com", "member_id": 9, "moderation_action": "defer", + "role": "member", "self_link": "http://localhost:9001/3.0/members/9", "user": + "http://localhost:9001/3.0/users/8"}'} headers: - content-length: ['360'] + content-length: ['384'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -531,13 +579,13 @@ uri: http://localhost:9001/3.0/users response: body: {string: !!python/unicode '{"entries": [{"created_on": "2005-08-01T07:49:23", - "http_etag": "\"da580436b3678aaf11186eefd19f1fd036d20bdb\"", "is_server_owner": - false, "password": "$6$rounds=652497$Ky7AXWjmBkJcW6N.$6eyXKmZLLFni0JpVgun3ziCaDVv00U79xwBCYelOdqkgcY1KvLkbqAf0TctDqYnZoZuAmblunGgsQjNiNU8aD.", - "self_link": "http://localhost:9001/3.0/users/121", "user_id": 121}], "http_etag": - "\"22ee67dda81d7967ae507dea16e61a941aaa58ef\"", "start": 0, "total_size": + "http_etag": "\"08f2542493d0aaaf751b60d97566fc444c747cd0\"", "is_server_owner": + false, "password": "$6$rounds=600893$NFsx42Q5cHXTSjHA$SonrSBbYGBjuS3J5pLQ4VLOvgFP8AyECkz/ZmyI9dmbiG9fL98/9wH6plsLMoiHZ1vdmN.kI.NUFO6ZUu.X2C1", + "self_link": "http://localhost:9001/3.0/users/8", "user_id": 8}], "http_etag": + "\"a9c5e85f975242aac8c3e01c8a5af998e43db63c\"", "start": 0, "total_size": 1}'} headers: - content-length: ['433'] + content-length: ['429'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -545,7 +593,7 @@ headers: accept-encoding: ['gzip, deflate'] method: !!python/unicode DELETE - uri: http://localhost:9001/3.0/users/121 + uri: http://localhost:9001/3.0/users/8 response: body: {string: !!python/unicode ''} headers: diff --git a/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_subscribe_mod.yaml b/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_subscribe_mod.yaml index 79334bb..e3c5ba7 100644 --- a/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_subscribe_mod.yaml +++ b/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_subscribe_mod.yaml @@ -187,7 +187,7 @@ body: {string: !!python/unicode ''} headers: content-length: ['0'] - location: ['http://localhost:9001/3.0/users/122'] + location: ['http://localhost:9001/3.0/users/9'] status: {code: 201, message: Created} - request: body: email=fritz%40example.org @@ -195,7 +195,7 @@ accept-encoding: ['gzip, deflate'] !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] method: !!python/unicode POST - uri: http://localhost:9001/3.0/users/122/addresses + uri: http://localhost:9001/3.0/users/9/addresses response: body: {string: !!python/unicode ''} headers: @@ -206,6 +206,40 @@ body: null headers: accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/users/9 + response: + body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": + "\"09178c340bccca10ce9be9d4b96b177bb3b232ea\"", "is_server_owner": false, + "password": "$6$rounds=661416$COecD24BRakoB2y.$HVF3XOwOuXrKs6VVcVJPaJSKZV9OfYrcNx9ao.TuBHH6nJb1b1/3MepRFp5NAdiBFJ/KU1TaihchVKjXbZcMn/", + "self_link": "http://localhost:9001/3.0/users/9", "user_id": 9}'} + headers: + content-length: ['324'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/users/9/addresses + response: + body: {string: !!python/unicode '{"entries": [{"email": "fritz@example.org", "http_etag": + "\"1d655761300c9a203a280f3a2be9e133eb802280\"", "original_email": "fritz@example.org", + "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/fritz@example.org", + "user": "http://localhost:9001/3.0/users/9"}, {"email": "test@example.com", + "http_etag": "\"83c6dfb813c2b4484f0c15eb434e104521bb2409\"", "original_email": + "test@example.com", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/test@example.com", + "user": "http://localhost:9001/3.0/users/9"}], "http_etag": "\"f14c73914079e826a370b6b434148753e7c21e65\"", + "start": 0, "total_size": 2}'} + headers: + content-length: ['674'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] method: !!python/unicode POST uri: http://localhost:9001/3.0/addresses/fritz@example.org/verify response: @@ -217,15 +251,26 @@ body: null headers: accept-encoding: ['gzip, deflate'] + method: !!python/unicode POST + uri: http://localhost:9001/3.0/addresses/test@example.com/verify + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + status: {code: 204, message: No Content} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] method: !!python/unicode GET uri: http://localhost:9001/3.0/users/test@example.com response: body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": - "\"721554143804444b7566bedff05c98352bbe43a1\"", "is_server_owner": false, - "password": "$6$rounds=597357$KK4dxc9s3RQkNOjg$.p79951iXVUX5vONPrwFQjS8gk4EA8Msv16TsiiQJlKmyYBHJWlxdTEKEBnYqxQ.fEg9wqyfRHz.a0v4YLwY91", - "self_link": "http://localhost:9001/3.0/users/122", "user_id": 122}'} + "\"09178c340bccca10ce9be9d4b96b177bb3b232ea\"", "is_server_owner": false, + "password": "$6$rounds=661416$COecD24BRakoB2y.$HVF3XOwOuXrKs6VVcVJPaJSKZV9OfYrcNx9ao.TuBHH6nJb1b1/3MepRFp5NAdiBFJ/KU1TaihchVKjXbZcMn/", + "self_link": "http://localhost:9001/3.0/users/9", "user_id": 9}'} headers: - content-length: ['328'] + content-length: ['324'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -233,19 +278,20 @@ headers: accept-encoding: ['gzip, deflate'] method: !!python/unicode GET - uri: http://localhost:9001/3.0/users/122/addresses + uri: http://localhost:9001/3.0/users/9/addresses response: body: {string: !!python/unicode '{"entries": [{"email": "fritz@example.org", "http_etag": - "\"60202ff1ed84efbfbfefa33375c637a34552dbf8\"", "original_email": "fritz@example.org", + "\"8d3a06e7ab49e4715967bd3b56099967748b6868\"", "original_email": "fritz@example.org", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/fritz@example.org", - "user": "http://localhost:9001/3.0/users/122", "verified_on": "2005-08-01T07:49:23"}, - {"email": "test@example.com", "http_etag": "\"16c12d3da544699b5e19b608b7fed8f15520fd57\"", + "user": "http://localhost:9001/3.0/users/9", "verified_on": "2005-08-01T07:49:23"}, + {"email": "test@example.com", "http_etag": "\"2afcbb8fefb40767dad968ef1e48b3878327fd41\"", "original_email": "test@example.com", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/test@example.com", "user": - "http://localhost:9001/3.0/users/122"}], "http_etag": "\"6a239c8e850f5f65459b9ddaf2357c1d99a10d40\"", - "start": 0, "total_size": 2}'} + "http://localhost:9001/3.0/users/9", "verified_on": "2005-08-01T07:49:23"}], + "http_etag": "\"fc174c7edd4b34be2708e9c2664de68b21006355\"", "start": 0, "total_size": + 2}'} headers: - content-length: ['716'] + content-length: ['750'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -298,8 +344,8 @@ method: !!python/unicode POST uri: http://localhost:9001/3.0/members response: - body: {string: !!python/unicode '{"http_etag": "\"c63c029e701c8257e2a249d1c41d50660434b11f\"", - "token": "0000000000000000000000000000000000000003", "token_owner": "moderator"}'} + body: {string: !!python/unicode '{"http_etag": "\"fbcd5c8df6304a514d4bfa0b753b54857674d8dc\"", + "token": "0000000000000000000000000000000000000002", "token_owner": "moderator"}'} headers: content-length: ['142'] content-type: [application/json; charset=utf-8] @@ -325,9 +371,9 @@ uri: http://localhost:9001/3.0/lists/moderate_subs@example.com/requests response: body: {string: !!python/unicode '{"entries": [{"display_name": "", "email": "test@example.com", - "http_etag": "\"05789eac34b1a55d8e9c373407d5bb9de8f07d7c\"", "list_id": "moderate_subs.example.com", - "token": "0000000000000000000000000000000000000003", "token_owner": "moderator", - "type": "subscription", "when": "2005-08-01T07:49:23"}], "http_etag": "\"97ec7ec659a863253fb5b45bbb3e7a2ec9549f96\"", + "http_etag": "\"ba9a1757c3532eef717cff3eb409185e5d041a85\"", "list_id": "moderate_subs.example.com", + "token": "0000000000000000000000000000000000000002", "token_owner": "moderator", + "type": "subscription", "when": "2005-08-01T07:49:23"}], "http_etag": "\"807af820973da5fcdb2f941b4ecc5ea7b035f533\"", "start": 0, "total_size": 1}'} headers: content-length: ['391'] @@ -341,11 +387,11 @@ uri: http://localhost:9001/3.0/users/test@example.com response: body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": - "\"721554143804444b7566bedff05c98352bbe43a1\"", "is_server_owner": false, - "password": "$6$rounds=597357$KK4dxc9s3RQkNOjg$.p79951iXVUX5vONPrwFQjS8gk4EA8Msv16TsiiQJlKmyYBHJWlxdTEKEBnYqxQ.fEg9wqyfRHz.a0v4YLwY91", - "self_link": "http://localhost:9001/3.0/users/122", "user_id": 122}'} + "\"09178c340bccca10ce9be9d4b96b177bb3b232ea\"", "is_server_owner": false, + "password": "$6$rounds=661416$COecD24BRakoB2y.$HVF3XOwOuXrKs6VVcVJPaJSKZV9OfYrcNx9ao.TuBHH6nJb1b1/3MepRFp5NAdiBFJ/KU1TaihchVKjXbZcMn/", + "self_link": "http://localhost:9001/3.0/users/9", "user_id": 9}'} headers: - content-length: ['328'] + content-length: ['324'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -353,20 +399,20 @@ headers: accept-encoding: ['gzip, deflate'] method: !!python/unicode GET - uri: http://localhost:9001/3.0/users/122/addresses + uri: http://localhost:9001/3.0/users/9/addresses response: body: {string: !!python/unicode '{"entries": [{"email": "fritz@example.org", "http_etag": - "\"60202ff1ed84efbfbfefa33375c637a34552dbf8\"", "original_email": "fritz@example.org", + "\"8d3a06e7ab49e4715967bd3b56099967748b6868\"", "original_email": "fritz@example.org", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/fritz@example.org", - "user": "http://localhost:9001/3.0/users/122", "verified_on": "2005-08-01T07:49:23"}, - {"email": "test@example.com", "http_etag": "\"ad2c899eeda3ab9e3562049351f2fdc0c9baba9c\"", + "user": "http://localhost:9001/3.0/users/9", "verified_on": "2005-08-01T07:49:23"}, + {"email": "test@example.com", "http_etag": "\"2afcbb8fefb40767dad968ef1e48b3878327fd41\"", "original_email": "test@example.com", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/test@example.com", "user": - "http://localhost:9001/3.0/users/122", "verified_on": "2005-08-01T07:49:23"}], - "http_etag": "\"ad5bf38a5093e093847afd73faa8c88d3da89464\"", "start": 0, "total_size": + "http://localhost:9001/3.0/users/9", "verified_on": "2005-08-01T07:49:23"}], + "http_etag": "\"fc174c7edd4b34be2708e9c2664de68b21006355\"", "start": 0, "total_size": 2}'} headers: - content-length: ['754'] + content-length: ['750'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -490,9 +536,9 @@ uri: http://localhost:9001/3.0/lists/moderate_subs@example.com/requests response: body: {string: !!python/unicode '{"entries": [{"display_name": "", "email": "test@example.com", - "http_etag": "\"05789eac34b1a55d8e9c373407d5bb9de8f07d7c\"", "list_id": "moderate_subs.example.com", - "token": "0000000000000000000000000000000000000003", "token_owner": "moderator", - "type": "subscription", "when": "2005-08-01T07:49:23"}], "http_etag": "\"97ec7ec659a863253fb5b45bbb3e7a2ec9549f96\"", + "http_etag": "\"ba9a1757c3532eef717cff3eb409185e5d041a85\"", "list_id": "moderate_subs.example.com", + "token": "0000000000000000000000000000000000000002", "token_owner": "moderator", + "type": "subscription", "when": "2005-08-01T07:49:23"}], "http_etag": "\"807af820973da5fcdb2f941b4ecc5ea7b035f533\"", "start": 0, "total_size": 1}'} headers: content-length: ['391'] @@ -504,7 +550,7 @@ accept-encoding: ['gzip, deflate'] !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] method: !!python/unicode POST - uri: http://localhost:9001/3.0/lists/moderate_subs.example.com/requests/0000000000000000000000000000000000000003 + uri: http://localhost:9001/3.0/lists/moderate_subs.example.com/requests/0000000000000000000000000000000000000002 response: body: {string: !!python/unicode ''} headers: @@ -545,13 +591,13 @@ uri: http://localhost:9001/3.0/users response: body: {string: !!python/unicode '{"entries": [{"created_on": "2005-08-01T07:49:23", - "http_etag": "\"721554143804444b7566bedff05c98352bbe43a1\"", "is_server_owner": - false, "password": "$6$rounds=597357$KK4dxc9s3RQkNOjg$.p79951iXVUX5vONPrwFQjS8gk4EA8Msv16TsiiQJlKmyYBHJWlxdTEKEBnYqxQ.fEg9wqyfRHz.a0v4YLwY91", - "self_link": "http://localhost:9001/3.0/users/122", "user_id": 122}], "http_etag": - "\"e8f4c4c6e4a45894cfdcfc603b26cd76fd5c91b3\"", "start": 0, "total_size": + "http_etag": "\"09178c340bccca10ce9be9d4b96b177bb3b232ea\"", "is_server_owner": + false, "password": "$6$rounds=661416$COecD24BRakoB2y.$HVF3XOwOuXrKs6VVcVJPaJSKZV9OfYrcNx9ao.TuBHH6nJb1b1/3MepRFp5NAdiBFJ/KU1TaihchVKjXbZcMn/", + "self_link": "http://localhost:9001/3.0/users/9", "user_id": 9}], "http_etag": + "\"f294e8055631403e4d066b44cc5e560671f55c9b\"", "start": 0, "total_size": 1}'} headers: - content-length: ['433'] + content-length: ['429'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -559,7 +605,7 @@ headers: accept-encoding: ['gzip, deflate'] method: !!python/unicode DELETE - uri: http://localhost:9001/3.0/users/122 + uri: http://localhost:9001/3.0/users/9 response: body: {string: !!python/unicode ''} headers: diff --git a/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_subscribe_mod_then_open.yaml b/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_subscribe_mod_then_open.yaml index dcc6185..728c0d4 100644 --- a/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_subscribe_mod_then_open.yaml +++ b/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_subscribe_mod_then_open.yaml @@ -187,7 +187,7 @@ body: {string: !!python/unicode ''} headers: content-length: ['0'] - location: ['http://localhost:9001/3.0/users/123'] + location: ['http://localhost:9001/3.0/users/10'] status: {code: 201, message: Created} - request: body: email=fritz%40example.org @@ -195,7 +195,7 @@ accept-encoding: ['gzip, deflate'] !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] method: !!python/unicode POST - uri: http://localhost:9001/3.0/users/123/addresses + uri: http://localhost:9001/3.0/users/10/addresses response: body: {string: !!python/unicode ''} headers: @@ -206,6 +206,40 @@ body: null headers: accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/users/10 + response: + body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": + "\"daa1431a31ddb12e656c2ff5aba6ff14f9faf85f\"", "is_server_owner": false, + "password": "$6$rounds=672692$L/QZnC96jwiip2bF$aA7uynLReeaWZN/YJ6GmV6WcEk.DiiGGYmAgpgeHNtTO7Ck5uUGH0jeAbXJ.AB5Z9sJtz8d/NxMzWOQvF8nP91", + "self_link": "http://localhost:9001/3.0/users/10", "user_id": 10}'} + headers: + content-length: ['326'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/users/10/addresses + response: + body: {string: !!python/unicode '{"entries": [{"email": "fritz@example.org", "http_etag": + "\"accae9afdb6505b1034b56e58a195d60488ace0e\"", "original_email": "fritz@example.org", + "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/fritz@example.org", + "user": "http://localhost:9001/3.0/users/10"}, {"email": "test@example.com", + "http_etag": "\"653c988d25ef432406061ef93716f4d0679d110c\"", "original_email": + "test@example.com", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/test@example.com", + "user": "http://localhost:9001/3.0/users/10"}], "http_etag": "\"ae98e42a83a42897babea6e73012645d29278827\"", + "start": 0, "total_size": 2}'} + headers: + content-length: ['676'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] method: !!python/unicode POST uri: http://localhost:9001/3.0/addresses/fritz@example.org/verify response: @@ -217,15 +251,26 @@ body: null headers: accept-encoding: ['gzip, deflate'] + method: !!python/unicode POST + uri: http://localhost:9001/3.0/addresses/test@example.com/verify + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + status: {code: 204, message: No Content} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] method: !!python/unicode GET uri: http://localhost:9001/3.0/users/test@example.com response: body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": - "\"8da9e8f59c2948581b12ea4ba0ee543b658648c0\"", "is_server_owner": false, - "password": "$6$rounds=668131$vf0oDBliUcngck5R$/P51i1FWKsNmeow6Lk2Z/.tMCo75Uvk9lIoA3hPBzDGH3VNiMJAs9BhBvKm1XXpfoBPLHrxsiU9wh3YesIexo1", - "self_link": "http://localhost:9001/3.0/users/123", "user_id": 123}'} + "\"daa1431a31ddb12e656c2ff5aba6ff14f9faf85f\"", "is_server_owner": false, + "password": "$6$rounds=672692$L/QZnC96jwiip2bF$aA7uynLReeaWZN/YJ6GmV6WcEk.DiiGGYmAgpgeHNtTO7Ck5uUGH0jeAbXJ.AB5Z9sJtz8d/NxMzWOQvF8nP91", + "self_link": "http://localhost:9001/3.0/users/10", "user_id": 10}'} headers: - content-length: ['328'] + content-length: ['326'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -233,19 +278,20 @@ headers: accept-encoding: ['gzip, deflate'] method: !!python/unicode GET - uri: http://localhost:9001/3.0/users/123/addresses + uri: http://localhost:9001/3.0/users/10/addresses response: body: {string: !!python/unicode '{"entries": [{"email": "fritz@example.org", "http_etag": - "\"82b97451cbcc7a5a00d1cc94fa2467cab976822c\"", "original_email": "fritz@example.org", + "\"df83de584130f7bf666f498f1ee86526580e1e5d\"", "original_email": "fritz@example.org", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/fritz@example.org", - "user": "http://localhost:9001/3.0/users/123", "verified_on": "2005-08-01T07:49:23"}, - {"email": "test@example.com", "http_etag": "\"abd9d1d4a62167415964ec11e1d74c3d193aadbe\"", + "user": "http://localhost:9001/3.0/users/10", "verified_on": "2005-08-01T07:49:23"}, + {"email": "test@example.com", "http_etag": "\"1a4e4fafa5f557004d12321255ecbe22b7bc4939\"", "original_email": "test@example.com", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/test@example.com", "user": - "http://localhost:9001/3.0/users/123"}], "http_etag": "\"b16177aab4d9861ad5ad48b1ee76d2157b01722d\"", - "start": 0, "total_size": 2}'} + "http://localhost:9001/3.0/users/10", "verified_on": "2005-08-01T07:49:23"}], + "http_etag": "\"6786a8956fe1455ab474e278103e3a85f08e0896\"", "start": 0, "total_size": + 2}'} headers: - content-length: ['716'] + content-length: ['752'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -298,8 +344,8 @@ method: !!python/unicode POST uri: http://localhost:9001/3.0/members response: - body: {string: !!python/unicode '{"http_etag": "\"5480a4c844f282957ebb374ced8ce88fa58b6585\"", - "token": "0000000000000000000000000000000000000004", "token_owner": "moderator"}'} + body: {string: !!python/unicode '{"http_etag": "\"c63c029e701c8257e2a249d1c41d50660434b11f\"", + "token": "0000000000000000000000000000000000000003", "token_owner": "moderator"}'} headers: content-length: ['142'] content-type: [application/json; charset=utf-8] @@ -325,9 +371,9 @@ uri: http://localhost:9001/3.0/lists/moderate_subs@example.com/requests response: body: {string: !!python/unicode '{"entries": [{"display_name": "", "email": "test@example.com", - "http_etag": "\"e4212c5fc5242e26387ecc198ed836969112d7c3\"", "list_id": "moderate_subs.example.com", - "token": "0000000000000000000000000000000000000004", "token_owner": "moderator", - "type": "subscription", "when": "2005-08-01T07:49:23"}], "http_etag": "\"4913cf6755cf9cd8a400986c70792d2c62993529\"", + "http_etag": "\"05789eac34b1a55d8e9c373407d5bb9de8f07d7c\"", "list_id": "moderate_subs.example.com", + "token": "0000000000000000000000000000000000000003", "token_owner": "moderator", + "type": "subscription", "when": "2005-08-01T07:49:23"}], "http_etag": "\"97ec7ec659a863253fb5b45bbb3e7a2ec9549f96\"", "start": 0, "total_size": 1}'} headers: content-length: ['391'] @@ -423,7 +469,7 @@ body: {string: !!python/unicode ''} headers: content-length: ['0'] - location: ['http://localhost:9001/3.0/members/107'] + location: ['http://localhost:9001/3.0/members/10'] status: {code: 201, message: Created} - request: body: list_id=moderate_subs.example.com&role=owner&subscriber=owner%40example.com @@ -436,7 +482,7 @@ body: {string: !!python/unicode ''} headers: content-length: ['0'] - location: ['http://localhost:9001/3.0/members/108'] + location: ['http://localhost:9001/3.0/members/11'] status: {code: 201, message: Created} - request: body: null @@ -446,9 +492,9 @@ uri: http://localhost:9001/3.0/lists/moderate_subs@example.com/requests response: body: {string: !!python/unicode '{"entries": [{"display_name": "", "email": "test@example.com", - "http_etag": "\"e4212c5fc5242e26387ecc198ed836969112d7c3\"", "list_id": "moderate_subs.example.com", - "token": "0000000000000000000000000000000000000004", "token_owner": "moderator", - "type": "subscription", "when": "2005-08-01T07:49:23"}], "http_etag": "\"4913cf6755cf9cd8a400986c70792d2c62993529\"", + "http_etag": "\"05789eac34b1a55d8e9c373407d5bb9de8f07d7c\"", "list_id": "moderate_subs.example.com", + "token": "0000000000000000000000000000000000000003", "token_owner": "moderator", + "type": "subscription", "when": "2005-08-01T07:49:23"}], "http_etag": "\"97ec7ec659a863253fb5b45bbb3e7a2ec9549f96\"", "start": 0, "total_size": 1}'} headers: content-length: ['391'] @@ -462,10 +508,10 @@ uri: http://localhost:9001/3.0/users/owner@example.com response: body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": - "\"39ea9156496f2970f184967c90e2312324b8ce44\"", "is_server_owner": false, - "self_link": "http://localhost:9001/3.0/users/124", "user_id": 124}'} + "\"4c816726023bb1daf76d48e82b250689df6a4694\"", "is_server_owner": false, + "self_link": "http://localhost:9001/3.0/users/11", "user_id": 11}'} headers: - content-length: ['192'] + content-length: ['190'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -473,15 +519,15 @@ headers: accept-encoding: ['gzip, deflate'] method: !!python/unicode GET - uri: http://localhost:9001/3.0/users/124/addresses + uri: http://localhost:9001/3.0/users/11/addresses response: body: {string: !!python/unicode '{"entries": [{"email": "owner@example.com", "http_etag": - "\"5ce4ab5537b937cfe2a473be997b7c5741e00687\"", "original_email": "owner@example.com", + "\"e9959829dbaa9f08bd552966891c6297941b3e5a\"", "original_email": "owner@example.com", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/owner@example.com", - "user": "http://localhost:9001/3.0/users/124"}], "http_etag": "\"e61ee3265484b12d7b0917ffa76428892edc3903\"", + "user": "http://localhost:9001/3.0/users/11"}], "http_etag": "\"15e3e5d87fdaaf4d8e762da1a0e4d6b90ef2150c\"", "start": 0, "total_size": 1}'} headers: - content-length: ['392'] + content-length: ['391'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -508,13 +554,13 @@ uri: http://localhost:9001/3.0/lists/moderate_subs.example.com/roster/owner response: body: {string: !!python/unicode '{"entries": [{"address": "http://localhost:9001/3.0/addresses/owner@example.com", - "delivery_mode": "regular", "email": "owner@example.com", "http_etag": "\"e86417154b9915a25e3427bce87e53edd7ceff53\"", - "list_id": "moderate_subs.example.com", "member_id": 108, "moderation_action": - "accept", "role": "owner", "self_link": "http://localhost:9001/3.0/members/108", - "user": "http://localhost:9001/3.0/users/124"}], "http_etag": "\"7511e6fbd32d21c774c5bf402b542b19b7b8d25a\"", + "delivery_mode": "regular", "email": "owner@example.com", "http_etag": "\"2844b48cc10f8fa8e03e571bda9d7ee35be4299f\"", + "list_id": "moderate_subs.example.com", "member_id": 11, "moderation_action": + "accept", "role": "owner", "self_link": "http://localhost:9001/3.0/members/11", + "user": "http://localhost:9001/3.0/users/11"}], "http_etag": "\"d28a2ea1df070cd2b77a937646a632089c5a824c\"", "start": 0, "total_size": 1}'} headers: - content-length: ['499'] + content-length: ['496'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -552,7 +598,7 @@ accept-encoding: ['gzip, deflate'] !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] method: !!python/unicode POST - uri: http://localhost:9001/3.0/lists/moderate_subs.example.com/requests/0000000000000000000000000000000000000004 + uri: http://localhost:9001/3.0/lists/moderate_subs.example.com/requests/0000000000000000000000000000000000000003 response: body: {string: !!python/unicode Already subscribed} headers: @@ -567,10 +613,10 @@ uri: http://localhost:9001/3.0/users/owner@example.com response: body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": - "\"39ea9156496f2970f184967c90e2312324b8ce44\"", "is_server_owner": false, - "self_link": "http://localhost:9001/3.0/users/124", "user_id": 124}'} + "\"4c816726023bb1daf76d48e82b250689df6a4694\"", "is_server_owner": false, + "self_link": "http://localhost:9001/3.0/users/11", "user_id": 11}'} headers: - content-length: ['192'] + content-length: ['190'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -578,15 +624,15 @@ headers: accept-encoding: ['gzip, deflate'] method: !!python/unicode GET - uri: http://localhost:9001/3.0/users/124/addresses + uri: http://localhost:9001/3.0/users/11/addresses response: body: {string: !!python/unicode '{"entries": [{"email": "owner@example.com", "http_etag": - "\"5ce4ab5537b937cfe2a473be997b7c5741e00687\"", "original_email": "owner@example.com", + "\"e9959829dbaa9f08bd552966891c6297941b3e5a\"", "original_email": "owner@example.com", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/owner@example.com", - "user": "http://localhost:9001/3.0/users/124"}], "http_etag": "\"e61ee3265484b12d7b0917ffa76428892edc3903\"", + "user": "http://localhost:9001/3.0/users/11"}], "http_etag": "\"15e3e5d87fdaaf4d8e762da1a0e4d6b90ef2150c\"", "start": 0, "total_size": 1}'} headers: - content-length: ['392'] + content-length: ['391'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -613,13 +659,13 @@ uri: http://localhost:9001/3.0/lists/moderate_subs.example.com/roster/owner response: body: {string: !!python/unicode '{"entries": [{"address": "http://localhost:9001/3.0/addresses/owner@example.com", - "delivery_mode": "regular", "email": "owner@example.com", "http_etag": "\"e86417154b9915a25e3427bce87e53edd7ceff53\"", - "list_id": "moderate_subs.example.com", "member_id": 108, "moderation_action": - "accept", "role": "owner", "self_link": "http://localhost:9001/3.0/members/108", - "user": "http://localhost:9001/3.0/users/124"}], "http_etag": "\"7511e6fbd32d21c774c5bf402b542b19b7b8d25a\"", + "delivery_mode": "regular", "email": "owner@example.com", "http_etag": "\"2844b48cc10f8fa8e03e571bda9d7ee35be4299f\"", + "list_id": "moderate_subs.example.com", "member_id": 11, "moderation_action": + "accept", "role": "owner", "self_link": "http://localhost:9001/3.0/members/11", + "user": "http://localhost:9001/3.0/users/11"}], "http_etag": "\"d28a2ea1df070cd2b77a937646a632089c5a824c\"", "start": 0, "total_size": 1}'} headers: - content-length: ['499'] + content-length: ['496'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -725,15 +771,15 @@ uri: http://localhost:9001/3.0/users response: body: {string: !!python/unicode '{"entries": [{"created_on": "2005-08-01T07:49:23", - "http_etag": "\"8da9e8f59c2948581b12ea4ba0ee543b658648c0\"", "is_server_owner": - false, "password": "$6$rounds=668131$vf0oDBliUcngck5R$/P51i1FWKsNmeow6Lk2Z/.tMCo75Uvk9lIoA3hPBzDGH3VNiMJAs9BhBvKm1XXpfoBPLHrxsiU9wh3YesIexo1", - "self_link": "http://localhost:9001/3.0/users/123", "user_id": 123}, {"created_on": - "2005-08-01T07:49:23", "http_etag": "\"39ea9156496f2970f184967c90e2312324b8ce44\"", - "is_server_owner": false, "self_link": "http://localhost:9001/3.0/users/124", - "user_id": 124}], "http_etag": "\"fc4eb3524d0bdf5d6898fba757c0ca761ebf56bd\"", + "http_etag": "\"daa1431a31ddb12e656c2ff5aba6ff14f9faf85f\"", "is_server_owner": + false, "password": "$6$rounds=672692$L/QZnC96jwiip2bF$aA7uynLReeaWZN/YJ6GmV6WcEk.DiiGGYmAgpgeHNtTO7Ck5uUGH0jeAbXJ.AB5Z9sJtz8d/NxMzWOQvF8nP91", + "self_link": "http://localhost:9001/3.0/users/10", "user_id": 10}, {"created_on": + "2005-08-01T07:49:23", "http_etag": "\"4c816726023bb1daf76d48e82b250689df6a4694\"", + "is_server_owner": false, "self_link": "http://localhost:9001/3.0/users/11", + "user_id": 11}], "http_etag": "\"a930406d6db2c0495bf555b49bae014c3f147cdc\"", "start": 0, "total_size": 2}'} headers: - content-length: ['627'] + content-length: ['623'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -741,7 +787,7 @@ headers: accept-encoding: ['gzip, deflate'] method: !!python/unicode DELETE - uri: http://localhost:9001/3.0/users/123 + uri: http://localhost:9001/3.0/users/10 response: body: {string: !!python/unicode ''} headers: @@ -752,7 +798,7 @@ headers: accept-encoding: ['gzip, deflate'] method: !!python/unicode DELETE - uri: http://localhost:9001/3.0/users/124 + uri: http://localhost:9001/3.0/users/11 response: body: {string: !!python/unicode ''} headers: diff --git a/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_subscribe_open.yaml b/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_subscribe_open.yaml index 684b900..fd5588c 100644 --- a/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_subscribe_open.yaml +++ b/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_subscribe_open.yaml @@ -187,7 +187,7 @@ body: {string: !!python/unicode ''} headers: content-length: ['0'] - location: ['http://localhost:9001/3.0/users/125'] + location: ['http://localhost:9001/3.0/users/12'] status: {code: 201, message: Created} - request: body: email=fritz%40example.org @@ -195,7 +195,7 @@ accept-encoding: ['gzip, deflate'] !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] method: !!python/unicode POST - uri: http://localhost:9001/3.0/users/125/addresses + uri: http://localhost:9001/3.0/users/12/addresses response: body: {string: !!python/unicode ''} headers: @@ -206,6 +206,40 @@ body: null headers: accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/users/12 + response: + body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": + "\"bcb05b92aae1b5e4e6fda6bcb0c4a2ae1564256c\"", "is_server_owner": false, + "password": "$6$rounds=636343$OJ5rgDAJYh5cq6Aa$NF8WPzCTTCvVQ3zp9nQZXK99JqcVSlcX7bBgNMlA765AgZLkoUwwlWdoS3kRlJKsH55BeHXKF8J9Ults0YZ650", + "self_link": "http://localhost:9001/3.0/users/12", "user_id": 12}'} + headers: + content-length: ['326'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/users/12/addresses + response: + body: {string: !!python/unicode '{"entries": [{"email": "fritz@example.org", "http_etag": + "\"de45f651ca0c2b01f31bd759ce7b963dae2b0c09\"", "original_email": "fritz@example.org", + "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/fritz@example.org", + "user": "http://localhost:9001/3.0/users/12"}, {"email": "test@example.com", + "http_etag": "\"7153fc9edd12dfb866876de2d6ff5b66fbd13574\"", "original_email": + "test@example.com", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/test@example.com", + "user": "http://localhost:9001/3.0/users/12"}], "http_etag": "\"9622288daa6ceeeeb77d9a30775f90ee6fa47a4b\"", + "start": 0, "total_size": 2}'} + headers: + content-length: ['676'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] method: !!python/unicode POST uri: http://localhost:9001/3.0/addresses/fritz@example.org/verify response: @@ -217,15 +251,26 @@ body: null headers: accept-encoding: ['gzip, deflate'] + method: !!python/unicode POST + uri: http://localhost:9001/3.0/addresses/test@example.com/verify + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + status: {code: 204, message: No Content} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] method: !!python/unicode GET uri: http://localhost:9001/3.0/users/test@example.com response: body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": - "\"c97d4da0dcfb43b971214ec88a40e2129d66f4f4\"", "is_server_owner": false, - "password": "$6$rounds=591582$MInVFgQQNdvlLnqH$GplQeJY/lzk2HGKugWlEw0jiwRVBRYDCD1J46h.8CmgZouADA2oltJ.MHOda/.35AJbIFLBKwB80sTEf72EuI1", - "self_link": "http://localhost:9001/3.0/users/125", "user_id": 125}'} + "\"bcb05b92aae1b5e4e6fda6bcb0c4a2ae1564256c\"", "is_server_owner": false, + "password": "$6$rounds=636343$OJ5rgDAJYh5cq6Aa$NF8WPzCTTCvVQ3zp9nQZXK99JqcVSlcX7bBgNMlA765AgZLkoUwwlWdoS3kRlJKsH55BeHXKF8J9Ults0YZ650", + "self_link": "http://localhost:9001/3.0/users/12", "user_id": 12}'} headers: - content-length: ['328'] + content-length: ['326'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -233,19 +278,20 @@ headers: accept-encoding: ['gzip, deflate'] method: !!python/unicode GET - uri: http://localhost:9001/3.0/users/125/addresses + uri: http://localhost:9001/3.0/users/12/addresses response: body: {string: !!python/unicode '{"entries": [{"email": "fritz@example.org", "http_etag": - "\"e891e0d247c77548e45c3db9666a9a43f2f346e4\"", "original_email": "fritz@example.org", + "\"b065016c0b921dbe7ad96865d4ca04ca2f1b229e\"", "original_email": "fritz@example.org", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/fritz@example.org", - "user": "http://localhost:9001/3.0/users/125", "verified_on": "2005-08-01T07:49:23"}, - {"email": "test@example.com", "http_etag": "\"1f1a1f279ff2a2d4675f2d762fb101fc83cfb2ce\"", + "user": "http://localhost:9001/3.0/users/12", "verified_on": "2005-08-01T07:49:23"}, + {"email": "test@example.com", "http_etag": "\"c2691b74d4b74fae84b878c07a4f2735424b0935\"", "original_email": "test@example.com", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/test@example.com", "user": - "http://localhost:9001/3.0/users/125"}], "http_etag": "\"2c690906100d7a87eb75b63ee622f1cea7ee9b8d\"", - "start": 0, "total_size": 2}'} + "http://localhost:9001/3.0/users/12", "verified_on": "2005-08-01T07:49:23"}], + "http_etag": "\"d16886fcdaa2a7285db84d6b85527e1baedb5c3c\"", "start": 0, "total_size": + 2}'} headers: - content-length: ['716'] + content-length: ['752'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -301,7 +347,7 @@ body: {string: !!python/unicode ''} headers: content-length: ['0'] - location: ['http://localhost:9001/3.0/members/109'] + location: ['http://localhost:9001/3.0/members/12'] status: {code: 201, message: Created} - request: body: null @@ -311,13 +357,13 @@ uri: http://localhost:9001/3.0/lists/open_list@example.com/roster/member response: body: {string: !!python/unicode '{"entries": [{"address": "http://localhost:9001/3.0/addresses/test@example.com", - "delivery_mode": "regular", "email": "test@example.com", "http_etag": "\"0fe2527095cc7cf37ead08b235f0de6ab057961a\"", - "list_id": "open_list.example.com", "member_id": 109, "role": "member", "self_link": - "http://localhost:9001/3.0/members/109", "user": "http://localhost:9001/3.0/users/125"}], - "http_etag": "\"c5dfeb102bbcda62808c504feeaa23f6fc2ad30c\"", "start": 0, "total_size": - 1}'} + "delivery_mode": "regular", "email": "test@example.com", "http_etag": "\"2e605c4441264cdf637d0a6b02fd75b8d88c9693\"", + "list_id": "open_list.example.com", "member_id": 12, "moderation_action": + "defer", "role": "member", "self_link": "http://localhost:9001/3.0/members/12", + "user": "http://localhost:9001/3.0/users/12"}], "http_etag": "\"dd5f1a82dc16fc803ff7c55823d6e3b964631476\"", + "start": 0, "total_size": 1}'} headers: - content-length: ['463'] + content-length: ['490'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -341,11 +387,11 @@ uri: http://localhost:9001/3.0/users/test@example.com response: body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": - "\"c97d4da0dcfb43b971214ec88a40e2129d66f4f4\"", "is_server_owner": false, - "password": "$6$rounds=591582$MInVFgQQNdvlLnqH$GplQeJY/lzk2HGKugWlEw0jiwRVBRYDCD1J46h.8CmgZouADA2oltJ.MHOda/.35AJbIFLBKwB80sTEf72EuI1", - "self_link": "http://localhost:9001/3.0/users/125", "user_id": 125}'} + "\"bcb05b92aae1b5e4e6fda6bcb0c4a2ae1564256c\"", "is_server_owner": false, + "password": "$6$rounds=636343$OJ5rgDAJYh5cq6Aa$NF8WPzCTTCvVQ3zp9nQZXK99JqcVSlcX7bBgNMlA765AgZLkoUwwlWdoS3kRlJKsH55BeHXKF8J9Ults0YZ650", + "self_link": "http://localhost:9001/3.0/users/12", "user_id": 12}'} headers: - content-length: ['328'] + content-length: ['326'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -353,20 +399,20 @@ headers: accept-encoding: ['gzip, deflate'] method: !!python/unicode GET - uri: http://localhost:9001/3.0/users/125/addresses + uri: http://localhost:9001/3.0/users/12/addresses response: body: {string: !!python/unicode '{"entries": [{"email": "fritz@example.org", "http_etag": - "\"e891e0d247c77548e45c3db9666a9a43f2f346e4\"", "original_email": "fritz@example.org", + "\"b065016c0b921dbe7ad96865d4ca04ca2f1b229e\"", "original_email": "fritz@example.org", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/fritz@example.org", - "user": "http://localhost:9001/3.0/users/125", "verified_on": "2005-08-01T07:49:23"}, - {"email": "test@example.com", "http_etag": "\"27865d8015dd04a54b201fc44858f0ff9e888f58\"", + "user": "http://localhost:9001/3.0/users/12", "verified_on": "2005-08-01T07:49:23"}, + {"email": "test@example.com", "http_etag": "\"c2691b74d4b74fae84b878c07a4f2735424b0935\"", "original_email": "test@example.com", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/test@example.com", "user": - "http://localhost:9001/3.0/users/125", "verified_on": "2005-08-01T07:49:23"}], - "http_etag": "\"4a9255833867c4bca1696cd1b5e3389c342af562\"", "start": 0, "total_size": + "http://localhost:9001/3.0/users/12", "verified_on": "2005-08-01T07:49:23"}], + "http_etag": "\"d16886fcdaa2a7285db84d6b85527e1baedb5c3c\"", "start": 0, "total_size": 2}'} headers: - content-length: ['754'] + content-length: ['752'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -419,11 +465,12 @@ uri: http://localhost:9001/3.0/lists/open_list.example.com/member/test@example.com response: body: {string: !!python/unicode '{"address": "http://localhost:9001/3.0/addresses/test@example.com", - "delivery_mode": "regular", "email": "test@example.com", "http_etag": "\"0fe2527095cc7cf37ead08b235f0de6ab057961a\"", - "list_id": "open_list.example.com", "member_id": 109, "role": "member", "self_link": - "http://localhost:9001/3.0/members/109", "user": "http://localhost:9001/3.0/users/125"}'} + "delivery_mode": "regular", "email": "test@example.com", "http_etag": "\"2e605c4441264cdf637d0a6b02fd75b8d88c9693\"", + "list_id": "open_list.example.com", "member_id": 12, "moderation_action": + "defer", "role": "member", "self_link": "http://localhost:9001/3.0/members/12", + "user": "http://localhost:9001/3.0/users/12"}'} headers: - content-length: ['358'] + content-length: ['385'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -520,13 +567,13 @@ uri: http://localhost:9001/3.0/users response: body: {string: !!python/unicode '{"entries": [{"created_on": "2005-08-01T07:49:23", - "http_etag": "\"c97d4da0dcfb43b971214ec88a40e2129d66f4f4\"", "is_server_owner": - false, "password": "$6$rounds=591582$MInVFgQQNdvlLnqH$GplQeJY/lzk2HGKugWlEw0jiwRVBRYDCD1J46h.8CmgZouADA2oltJ.MHOda/.35AJbIFLBKwB80sTEf72EuI1", - "self_link": "http://localhost:9001/3.0/users/125", "user_id": 125}], "http_etag": - "\"df761dec39c11b15dd2868b1e7934ced864cf11d\"", "start": 0, "total_size": + "http_etag": "\"bcb05b92aae1b5e4e6fda6bcb0c4a2ae1564256c\"", "is_server_owner": + false, "password": "$6$rounds=636343$OJ5rgDAJYh5cq6Aa$NF8WPzCTTCvVQ3zp9nQZXK99JqcVSlcX7bBgNMlA765AgZLkoUwwlWdoS3kRlJKsH55BeHXKF8J9Ults0YZ650", + "self_link": "http://localhost:9001/3.0/users/12", "user_id": 12}], "http_etag": + "\"63b01b03122cf5b8f9ee30e16fd299c9b6a50547\"", "start": 0, "total_size": 1}'} headers: - content-length: ['433'] + content-length: ['431'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -534,7 +581,7 @@ headers: accept-encoding: ['gzip, deflate'] method: !!python/unicode DELETE - uri: http://localhost:9001/3.0/users/125 + uri: http://localhost:9001/3.0/users/12 response: body: {string: !!python/unicode ''} headers: diff --git a/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_unknown_address.yaml b/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_unknown_address.yaml index daa28a8..0d735eb 100644 --- a/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_unknown_address.yaml +++ b/src/postorius/tests/fixtures/vcr_cassettes/TestSubscription.test_unknown_address.yaml @@ -187,7 +187,7 @@ body: {string: !!python/unicode ''} headers: content-length: ['0'] - location: ['http://localhost:9001/3.0/users/126'] + location: ['http://localhost:9001/3.0/users/13'] status: {code: 201, message: Created} - request: body: email=fritz%40example.org @@ -195,7 +195,7 @@ accept-encoding: ['gzip, deflate'] !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] method: !!python/unicode POST - uri: http://localhost:9001/3.0/users/126/addresses + uri: http://localhost:9001/3.0/users/13/addresses response: body: {string: !!python/unicode ''} headers: @@ -206,6 +206,40 @@ body: null headers: accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/users/13 + response: + body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": + "\"bf161ba253272bc9457d4407e8fb8c4e6ccb156d\"", "is_server_owner": false, + "password": "$6$rounds=693420$watqTPLMR7cjO/HK$NoOP1wvWS91bUOHhbxRvGLMQrK6q0/ebeKL/00YWuVdUlGcyGGejewV/DGFLd3AuJXC1L9KhNfF6MBs2Lj0LT/", + "self_link": "http://localhost:9001/3.0/users/13", "user_id": 13}'} + headers: + content-length: ['326'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode GET + uri: http://localhost:9001/3.0/users/13/addresses + response: + body: {string: !!python/unicode '{"entries": [{"email": "fritz@example.org", "http_etag": + "\"10e6832981d616ede4ff738c3dc7e69ae060b0c6\"", "original_email": "fritz@example.org", + "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/fritz@example.org", + "user": "http://localhost:9001/3.0/users/13"}, {"email": "test@example.com", + "http_etag": "\"183bd2070dec2c1087e072dede15f46d64ad4c23\"", "original_email": + "test@example.com", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/test@example.com", + "user": "http://localhost:9001/3.0/users/13"}], "http_etag": "\"c815381d58c4e1fb008e9a6b167a5ca14d6e57f4\"", + "start": 0, "total_size": 2}'} + headers: + content-length: ['676'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] method: !!python/unicode POST uri: http://localhost:9001/3.0/addresses/fritz@example.org/verify response: @@ -217,15 +251,26 @@ body: null headers: accept-encoding: ['gzip, deflate'] + method: !!python/unicode POST + uri: http://localhost:9001/3.0/addresses/test@example.com/verify + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + status: {code: 204, message: No Content} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] method: !!python/unicode GET uri: http://localhost:9001/3.0/users/test@example.com response: body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": - "\"50d1c6dff26fd89a3b9e00473a7381ff8c0d8869\"", "is_server_owner": false, - "password": "$6$rounds=708393$8VdXEgXr4664.8rF$WeEemk4eBOHjtLvGI4R4gwBJu2rHPdPxIsIlr07B2H4eZd6YqXqtuvlRfCX6EitBdnHl/O4KpYN1rmHIksgRw0", - "self_link": "http://localhost:9001/3.0/users/126", "user_id": 126}'} + "\"bf161ba253272bc9457d4407e8fb8c4e6ccb156d\"", "is_server_owner": false, + "password": "$6$rounds=693420$watqTPLMR7cjO/HK$NoOP1wvWS91bUOHhbxRvGLMQrK6q0/ebeKL/00YWuVdUlGcyGGejewV/DGFLd3AuJXC1L9KhNfF6MBs2Lj0LT/", + "self_link": "http://localhost:9001/3.0/users/13", "user_id": 13}'} headers: - content-length: ['328'] + content-length: ['326'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -233,19 +278,20 @@ headers: accept-encoding: ['gzip, deflate'] method: !!python/unicode GET - uri: http://localhost:9001/3.0/users/126/addresses + uri: http://localhost:9001/3.0/users/13/addresses response: body: {string: !!python/unicode '{"entries": [{"email": "fritz@example.org", "http_etag": - "\"78f0ec153a3a6e18e8b876a94226669b541e804b\"", "original_email": "fritz@example.org", + "\"43ecf4911970b7ba8e5412ad1cbaa0dd26c7f828\"", "original_email": "fritz@example.org", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/fritz@example.org", - "user": "http://localhost:9001/3.0/users/126", "verified_on": "2005-08-01T07:49:23"}, - {"email": "test@example.com", "http_etag": "\"3cece11446d4f4c665933c78a37a1571f853eeb3\"", + "user": "http://localhost:9001/3.0/users/13", "verified_on": "2005-08-01T07:49:23"}, + {"email": "test@example.com", "http_etag": "\"e0d8de52cd37343bdb52e4416d1bc9d962056121\"", "original_email": "test@example.com", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/test@example.com", "user": - "http://localhost:9001/3.0/users/126"}], "http_etag": "\"3e2f85206afd5711c9c7ae58992736ee4522fe7f\"", - "start": 0, "total_size": 2}'} + "http://localhost:9001/3.0/users/13", "verified_on": "2005-08-01T07:49:23"}], + "http_etag": "\"071216e1bacc56bd10619409175c5fd2bc18f6e6\"", "start": 0, "total_size": + 2}'} headers: - content-length: ['716'] + content-length: ['752'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -324,11 +370,11 @@ uri: http://localhost:9001/3.0/users/test@example.com response: body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": - "\"50d1c6dff26fd89a3b9e00473a7381ff8c0d8869\"", "is_server_owner": false, - "password": "$6$rounds=708393$8VdXEgXr4664.8rF$WeEemk4eBOHjtLvGI4R4gwBJu2rHPdPxIsIlr07B2H4eZd6YqXqtuvlRfCX6EitBdnHl/O4KpYN1rmHIksgRw0", - "self_link": "http://localhost:9001/3.0/users/126", "user_id": 126}'} + "\"bf161ba253272bc9457d4407e8fb8c4e6ccb156d\"", "is_server_owner": false, + "password": "$6$rounds=693420$watqTPLMR7cjO/HK$NoOP1wvWS91bUOHhbxRvGLMQrK6q0/ebeKL/00YWuVdUlGcyGGejewV/DGFLd3AuJXC1L9KhNfF6MBs2Lj0LT/", + "self_link": "http://localhost:9001/3.0/users/13", "user_id": 13}'} headers: - content-length: ['328'] + content-length: ['326'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -336,19 +382,20 @@ headers: accept-encoding: ['gzip, deflate'] method: !!python/unicode GET - uri: http://localhost:9001/3.0/users/126/addresses + uri: http://localhost:9001/3.0/users/13/addresses response: body: {string: !!python/unicode '{"entries": [{"email": "fritz@example.org", "http_etag": - "\"78f0ec153a3a6e18e8b876a94226669b541e804b\"", "original_email": "fritz@example.org", + "\"43ecf4911970b7ba8e5412ad1cbaa0dd26c7f828\"", "original_email": "fritz@example.org", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/fritz@example.org", - "user": "http://localhost:9001/3.0/users/126", "verified_on": "2005-08-01T07:49:23"}, - {"email": "test@example.com", "http_etag": "\"3cece11446d4f4c665933c78a37a1571f853eeb3\"", + "user": "http://localhost:9001/3.0/users/13", "verified_on": "2005-08-01T07:49:23"}, + {"email": "test@example.com", "http_etag": "\"e0d8de52cd37343bdb52e4416d1bc9d962056121\"", "original_email": "test@example.com", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/test@example.com", "user": - "http://localhost:9001/3.0/users/126"}], "http_etag": "\"3e2f85206afd5711c9c7ae58992736ee4522fe7f\"", - "start": 0, "total_size": 2}'} + "http://localhost:9001/3.0/users/13", "verified_on": "2005-08-01T07:49:23"}], + "http_etag": "\"071216e1bacc56bd10619409175c5fd2bc18f6e6\"", "start": 0, "total_size": + 2}'} headers: - content-length: ['716'] + content-length: ['752'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -511,13 +558,13 @@ uri: http://localhost:9001/3.0/users response: body: {string: !!python/unicode '{"entries": [{"created_on": "2005-08-01T07:49:23", - "http_etag": "\"50d1c6dff26fd89a3b9e00473a7381ff8c0d8869\"", "is_server_owner": - false, "password": "$6$rounds=708393$8VdXEgXr4664.8rF$WeEemk4eBOHjtLvGI4R4gwBJu2rHPdPxIsIlr07B2H4eZd6YqXqtuvlRfCX6EitBdnHl/O4KpYN1rmHIksgRw0", - "self_link": "http://localhost:9001/3.0/users/126", "user_id": 126}], "http_etag": - "\"142ddde5bc52291fd013341356af330ed67b072f\"", "start": 0, "total_size": + "http_etag": "\"bf161ba253272bc9457d4407e8fb8c4e6ccb156d\"", "is_server_owner": + false, "password": "$6$rounds=693420$watqTPLMR7cjO/HK$NoOP1wvWS91bUOHhbxRvGLMQrK6q0/ebeKL/00YWuVdUlGcyGGejewV/DGFLd3AuJXC1L9KhNfF6MBs2Lj0LT/", + "self_link": "http://localhost:9001/3.0/users/13", "user_id": 13}], "http_etag": + "\"4a1ebeb4f7f5eac15a2b7c4be415b8d7d5377cc4\"", "start": 0, "total_size": 1}'} headers: - content-length: ['433'] + content-length: ['431'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: @@ -525,7 +572,7 @@ headers: accept-encoding: ['gzip, deflate'] method: !!python/unicode DELETE - uri: http://localhost:9001/3.0/users/126 + uri: http://localhost:9001/3.0/users/13 response: body: {string: !!python/unicode ''} headers: diff --git a/src/postorius/tests/mailman_api_tests/test_subscriptions.py b/src/postorius/tests/mailman_api_tests/test_subscriptions.py index df47e8a..4cfb9bd 100644 --- a/src/postorius/tests/mailman_api_tests/test_subscriptions.py +++ b/src/postorius/tests/mailman_api_tests/test_subscriptions.py @@ -44,7 +44,9 @@ 'testuser', 'test@example.com', 'pwd') # Create Mailman user self.mm_user = self.mm_client.create_user('test@example.com', '') - self.mm_user.add_address('fritz@example.org').verify() + self.mm_user.add_address('fritz@example.org') + for address in self.mm_user.addresses: + address.verify() def tearDown(self): # XXX remove the method if core cleares requests on list deletion @@ -161,3 +163,49 @@ reverse('mass_subscribe', args=('open_list.example.com',)), {'emails': email_list}) self.assertEqual(len(self.open_list.members), 3) + + def test_change_subscription_open(self): + # The subscription is changed from an address to another + self.open_list.subscribe('test@example.com') + self.assertEqual(len(self.open_list.members), 1) + self.assertEqual(len(self.open_list.requests), 0) + self.client.login(username='testuser', password='pwd') + response = self.client.post( + reverse('change_subscription', args=['open_list.example.com']), + {'email': 'fritz@example.org'}) + self.assertHasSuccessMessage(response) + self.assertEqual(len(self.open_list.members), 1) + self.assertEqual(len(self.open_list.requests), 0) + try: + member = self.open_list.get_member('fritz@example.org') + except ValueError: + self.fail('The subscription was not changed') + self.assertEqual(member.email, 'fritz@example.org') + self.assertRedirects( + response, reverse('list_summary', + args=('open_list.example.com', ))) + + def test_change_subscription_confirm(self): + # The subscription is changed from an address to another + confirm_list = self.domain.create_list('confirm_list') + settings = confirm_list.settings + settings['subscription_policy'] = 'confirm' + settings.save() + confirm_list.subscribe('test@example.com', pre_confirmed=True) + self.assertEqual(len(confirm_list.members), 1) + self.assertEqual(len(confirm_list.requests), 0) + self.client.login(username='testuser', password='pwd') + response = self.client.post( + reverse('change_subscription', args=['confirm_list.example.com']), + {'email': 'fritz@example.org'}) + self.assertHasSuccessMessage(response) + self.assertEqual(len(confirm_list.members), 1) + self.assertEqual(len(confirm_list.requests), 0) + try: + member = confirm_list.get_member('fritz@example.org') + except ValueError: + self.fail('The subscription was not changed') + self.assertEqual(member.email, 'fritz@example.org') + self.assertRedirects( + response, reverse('list_summary', + args=('confirm_list.example.com', ))) diff --git a/src/postorius/views/list.py b/src/postorius/views/list.py index 0ed284c..5146215 100644 --- a/src/postorius/views/list.py +++ b/src/postorius/views/list.py @@ -220,6 +220,8 @@ try: user_emails = [request.user.email] + request.user.other_emails form = ListSubscribe(user_emails, request.POST) + # Find the currently subscribed email + old_email = None for address in user_emails: try: self.mailing_list.get_member(address) @@ -228,13 +230,16 @@ else: old_email = address break # no need to test more addresses + assert old_email is not None if form.is_valid(): email = form.cleaned_data['email'] if old_email == email: messages.error(request, _('You are already subscribed')) else: self.mailing_list.unsubscribe(old_email) - self.mailing_list.subscribe(email) + # Since the action is done via the web UI, no email + # confirmation is needed. + self.mailing_list.subscribe(email, pre_confirmed=True) messages.success(request, _('Subscription changed to %s') % email) else: