diff --git a/src/postorius/tests/fixtures/vcr_cassettes/DomainCreationTest.test_new_domain_created_with_owner.yaml b/src/postorius/tests/fixtures/vcr_cassettes/DomainCreationTest.test_new_domain_created_with_owner.yaml index 8d8fa2f..b6c97ae 100644 --- a/src/postorius/tests/fixtures/vcr_cassettes/DomainCreationTest.test_new_domain_created_with_owner.yaml +++ b/src/postorius/tests/fixtures/vcr_cassettes/DomainCreationTest.test_new_domain_created_with_owner.yaml @@ -3,10 +3,10 @@ body: null headers: accept-encoding: ['gzip, deflate'] - method: !!python/unicode GET + method: !!python/unicode 'GET' uri: http://localhost:9001/3.0/users/su@example.com response: - body: {string: !!python/unicode 404 Not Found} + body: {string: !!python/unicode '404 Not Found'} headers: content-length: ['13'] content-type: [application/json; charset=utf-8] @@ -15,8 +15,8 @@ body: base_url=http%3A%2F%2Fexample.com&description=A+new+Domain.&mail_host=example.com&owner=su%40example.com headers: accept-encoding: ['gzip, deflate'] - !!python/unicode content-type: [!!python/unicode application/x-www-form-urlencoded] - method: !!python/unicode POST + !!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 ''} @@ -28,37 +28,37 @@ body: null headers: accept-encoding: ['gzip, deflate'] - method: !!python/unicode GET + method: !!python/unicode 'GET' uri: http://localhost:9001/3.0/users/su@example.com response: body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": - "\"82f042707bad8528d367f38ace98ee0d7ff05e57\"", "is_server_owner": false, - "self_link": "http://localhost:9001/3.0/users/107", "user_id": 107}'} + "\"976a4412eb9cb5d0caff87e1fb125a75d8557190\"", "is_server_owner": false, + "self_link": "http://localhost:9001/3.0/users/2617", "user_id": 2617}'} headers: - content-length: ['192'] + content-length: ['194'] 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/107/addresses + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/users/2617/addresses response: body: {string: !!python/unicode '{"entries": [{"email": "su@example.com", "http_etag": - "\"0a9acce49bac565c4c9a6f82cbfa1071cf8431f9\"", "original_email": "su@example.com", + "\"7728784f9ba62dfdd42fe755547e5fbd4b6ebc64\"", "original_email": "su@example.com", "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/su@example.com", - "user": "http://localhost:9001/3.0/users/107"}], "http_etag": "\"3b2c12fee9e1570dd7a25f21b1bfa834bc650689\"", + "user": "http://localhost:9001/3.0/users/2617"}], "http_etag": "\"a1d3c7326c76c0eb992cbb349a0fcc9ac092a419\"", "start": 0, "total_size": 1}'} headers: - content-length: ['383'] + 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 + method: !!python/unicode 'GET' uri: http://localhost:9001/3.0/domains response: body: {string: !!python/unicode '{"entries": [{"base_url": "http://example.com", @@ -74,7 +74,7 @@ body: null headers: accept-encoding: ['gzip, deflate'] - method: !!python/unicode GET + method: !!python/unicode 'GET' uri: http://localhost:9001/3.0/domains/example.com response: body: {string: !!python/unicode '{"base_url": "http://example.com", "description": @@ -89,7 +89,7 @@ body: null headers: accept-encoding: ['gzip, deflate'] - method: !!python/unicode GET + method: !!python/unicode 'GET' uri: http://localhost:9001/3.0/domains/example.com response: body: {string: !!python/unicode '{"base_url": "http://example.com", "description": @@ -104,7 +104,7 @@ body: null headers: accept-encoding: ['gzip, deflate'] - method: !!python/unicode GET + method: !!python/unicode 'GET' uri: http://localhost:9001/3.0/domains/example.com response: body: {string: !!python/unicode '{"base_url": "http://example.com", "description": @@ -119,37 +119,37 @@ body: null headers: accept-encoding: ['gzip, deflate'] - method: !!python/unicode GET + method: !!python/unicode 'GET' uri: http://localhost:9001/3.0/domains/example.com/owners response: body: {string: !!python/unicode '{"entries": [{"created_on": "2005-08-01T07:49:23", - "http_etag": "\"82f042707bad8528d367f38ace98ee0d7ff05e57\"", "is_server_owner": - false, "self_link": "http://localhost:9001/3.0/users/107", "user_id": 107}], - "http_etag": "\"626cd7e8adb007ccfba5661536ba21d5aeb4209f\"", "start": 0, "total_size": + "http_etag": "\"976a4412eb9cb5d0caff87e1fb125a75d8557190\"", "is_server_owner": + false, "self_link": "http://localhost:9001/3.0/users/2617", "user_id": 2617}], + "http_etag": "\"ff75a8caf08c7fc6205bb7a4a8f1a41e03062b76\"", "start": 0, "total_size": 1}'} headers: - content-length: ['297'] + content-length: ['299'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: body: null headers: accept-encoding: ['gzip, deflate'] - method: !!python/unicode GET + method: !!python/unicode 'GET' uri: http://localhost:9001/3.0/users/su@example.com response: body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": - "\"82f042707bad8528d367f38ace98ee0d7ff05e57\"", "is_server_owner": false, - "self_link": "http://localhost:9001/3.0/users/107", "user_id": 107}'} + "\"976a4412eb9cb5d0caff87e1fb125a75d8557190\"", "is_server_owner": false, + "self_link": "http://localhost:9001/3.0/users/2617", "user_id": 2617}'} headers: - content-length: ['192'] + content-length: ['194'] content-type: [application/json; charset=utf-8] status: {code: 200, message: OK} - request: body: null headers: accept-encoding: ['gzip, deflate'] - method: !!python/unicode DELETE + method: !!python/unicode 'DELETE' uri: http://localhost:9001/3.0/domains/example.com response: body: {string: !!python/unicode ''} @@ -160,7 +160,7 @@ body: null headers: accept-encoding: ['gzip, deflate'] - method: !!python/unicode GET + method: !!python/unicode 'GET' uri: http://localhost:9001/3.0/domains response: body: {string: !!python/unicode '{"http_etag": "\"32223434a0f3af4cdc4673d1fbc5bac1f6d98fd3\"", @@ -173,24 +173,24 @@ body: null headers: accept-encoding: ['gzip, deflate'] - method: !!python/unicode GET + 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": "\"82f042707bad8528d367f38ace98ee0d7ff05e57\"", "is_server_owner": - false, "self_link": "http://localhost:9001/3.0/users/107", "user_id": 107}], - "http_etag": "\"626cd7e8adb007ccfba5661536ba21d5aeb4209f\"", "start": 0, "total_size": + "http_etag": "\"976a4412eb9cb5d0caff87e1fb125a75d8557190\"", "is_server_owner": + false, "self_link": "http://localhost:9001/3.0/users/2617", "user_id": 2617}], + "http_etag": "\"ff75a8caf08c7fc6205bb7a4a8f1a41e03062b76\"", "start": 0, "total_size": 1}'} headers: - content-length: ['297'] + content-length: ['299'] 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/107 + method: !!python/unicode 'DELETE' + uri: http://localhost:9001/3.0/users/2617 response: body: {string: !!python/unicode ''} headers: diff --git a/src/postorius/tests/fixtures/vcr_cassettes/DomainCreationTest.test_validation_of_mail_host.yaml b/src/postorius/tests/fixtures/vcr_cassettes/DomainCreationTest.test_validation_of_mail_host.yaml new file mode 100644 index 0000000..9a24357 --- /dev/null +++ b/src/postorius/tests/fixtures/vcr_cassettes/DomainCreationTest.test_validation_of_mail_host.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/users/su@example.com + response: + body: {string: !!python/unicode '404 Not Found'} + headers: + content-length: ['13'] + content-type: [application/json; charset=utf-8] + status: {code: 404, message: Not Found} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/domains + 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 + 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} +version: 1 diff --git a/src/postorius/tests/fixtures/vcr_cassettes/ListCreationTest.test_listname_validation.yaml b/src/postorius/tests/fixtures/vcr_cassettes/ListCreationTest.test_listname_validation.yaml new file mode 100644 index 0000000..8ae4236 --- /dev/null +++ b/src/postorius/tests/fixtures/vcr_cassettes/ListCreationTest.test_listname_validation.yaml @@ -0,0 +1,98 @@ +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/users/su@example.com + response: + body: {string: !!python/unicode '404 Not Found'} + headers: + content-length: ['13'] + content-type: [application/json; charset=utf-8] + status: {code: 404, message: Not Found} +- 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 '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: 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 '{"http_etag": "\"32223434a0f3af4cdc4673d1fbc5bac1f6d98fd3\"", + "start": 0, "total_size": 0}'} + headers: + content-length: ['90'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +version: 1 diff --git a/src/postorius/tests/fixtures/vcr_cassettes/ListMembersOptionsTest.test_not_accessible_for_moderator.yaml b/src/postorius/tests/fixtures/vcr_cassettes/ListMembersOptionsTest.test_not_accessible_for_moderator.yaml new file mode 100644 index 0000000..b9b54b7 --- /dev/null +++ b/src/postorius/tests/fixtures/vcr_cassettes/ListMembersOptionsTest.test_not_accessible_for_moderator.yaml @@ -0,0 +1,492 @@ +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=foo%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/foo.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/foo.example.com + response: + body: {string: !!python/unicode '{"display_name": "Foo", "fqdn_listname": "foo@example.com", + "http_etag": "\"698a819bbb6b902096a8c5543cc7fac2328960d5\"", "list_id": "foo.example.com", + "list_name": "foo", "mail_host": "example.com", "member_count": 0, "self_link": + "http://localhost:9001/3.0/lists/foo.example.com", "volume": 1}'} + headers: + content-length: ['294'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: list_id=foo.example.com&role=owner&subscriber=owner%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/4580'] + status: {code: 201, message: Created} +- request: + body: list_id=foo.example.com&role=moderator&subscriber=moderator%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/4581'] + status: {code: 201, message: Created} +- 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/2603'] + status: {code: 201, message: Created} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/users/2603 + response: + body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": + "\"01028cf2252303ed31683073cf13726312408108\"", "is_server_owner": false, + "password": "$6$rounds=662618$6xrZ4rQrBB8hSzaL$RdA1Z9Q95E7DOH10vz0rB5Vzrorluw.BWbPJmt2cZ2Mc3yDOGo6r1wJrtgaiG5p4jU/hrMkuqnfUpi0MjAorW/", + "self_link": "http://localhost:9001/3.0/users/2603", "user_id": 2603}'} + headers: + content-length: ['330'] + 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/2603/addresses + response: + body: {string: !!python/unicode '{"entries": [{"email": "test@example.com", "http_etag": + "\"e9e4e8cc659decdfe2f95dcf2216529ac067d24d\"", "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/2603"}], "http_etag": "\"607cbe30e196f5a431003e0232150df4fe4269c1\"", + "start": 0, "total_size": 1}'} + headers: + content-length: ['390'] + 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/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=foo.example.com&pre_approved=True&pre_confirmed=True&pre_verified=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/4582'] + status: {code: 201, message: Created} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/users/moderator@example.com + response: + body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": + "\"2654dd9289836cf68b2608957880cde5da86e8c2\"", "is_server_owner": false, + "self_link": "http://localhost:9001/3.0/users/2569", "user_id": 2569}'} + headers: + content-length: ['194'] + 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/2569/addresses + response: + body: {string: !!python/unicode '{"entries": [{"email": "moderator@example.com", + "http_etag": "\"9c8285f78e80becdaedbc1f04bf2a3e7330ed2a1\"", "original_email": + "moderator@example.com", "registered_on": "2005-08-01T07:49:23", "self_link": + "http://localhost:9001/3.0/addresses/moderator@example.com", "user": "http://localhost:9001/3.0/users/2569"}], + "http_etag": "\"6f5f79afccc63020c68b96a858389175e893fda7\"", "start": 0, "total_size": + 1}'} + headers: + content-length: ['405'] + 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/foo.example.com + response: + body: {string: !!python/unicode '{"display_name": "Foo", "fqdn_listname": "foo@example.com", + "http_etag": "\"98cc998d4a30293ec17da639bce10617912a6e1e\"", "list_id": "foo.example.com", + "list_name": "foo", "mail_host": "example.com", "member_count": 1, "self_link": + "http://localhost:9001/3.0/lists/foo.example.com", "volume": 1}'} + headers: + content-length: ['294'] + 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/foo.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": "\"188510c419f7a90a33608baac9853bc2904e26ce\"", + "list_id": "foo.example.com", "member_id": 4580, "moderation_action": "accept", + "role": "owner", "self_link": "http://localhost:9001/3.0/members/4580", "user": + "http://localhost:9001/3.0/users/2568"}], "http_etag": "\"0d49e02aa1e0558098f5e6804890e551e22f94c7\"", + "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/foo.example.com/roster/moderator + response: + body: {string: !!python/unicode '{"entries": [{"address": "http://localhost:9001/3.0/addresses/moderator@example.com", + "delivery_mode": "regular", "email": "moderator@example.com", "http_etag": + "\"a2050f1e3e8a8754c16b1ac2a6d270c743c27743\"", "list_id": "foo.example.com", + "member_id": 4581, "moderation_action": "accept", "role": "moderator", "self_link": + "http://localhost:9001/3.0/members/4581", "user": "http://localhost:9001/3.0/users/2569"}], + "http_etag": "\"d5fb908d143b060c38a4cb0eb2f23d40c62fc5e1\"", "start": 0, "total_size": + 1}'} + headers: + content-length: ['504'] + 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"}, {"base_url": "http://example.net", "description": + null, "http_etag": "\"0d2f2e58986938da3ee32b4625c8d2ee7818f5f8\"", "mail_host": + "example.net", "self_link": "http://localhost:9001/3.0/domains/example.net", + "url_host": "example.net"}, {"base_url": "http://example.org", "description": + "Example domain", "http_etag": "\"c13e61a042d2abbb10bb7f7547024b919e376dc2\"", + "mail_host": "example.org", "self_link": "http://localhost:9001/3.0/domains/example.org", + "url_host": "example.org"}, {"base_url": "http://allmy.example.com", "description": + "My new domain", "http_etag": "\"8a5f64e33a236a8c80a4a4ff64b0a7449940df6a\"", + "mail_host": "my.example.com", "self_link": "http://localhost:9001/3.0/domains/my.example.com", + "url_host": "allmy.example.com"}, {"base_url": "http://your.example.com", + "description": null, "http_etag": "\"d93fe2a3f55329c10082ea5d8b0bd8ce2461043b\"", + "mail_host": "your.example.com", "self_link": "http://localhost:9001/3.0/domains/your.example.com", + "url_host": "your.example.com"}], "http_etag": "\"742f26b8b146ac7a6260742c0093595b61664a75\"", + "start": 0, "total_size": 5}'} + headers: + content-length: ['1339'] + 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/my.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 '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 'DELETE' + uri: http://localhost:9001/3.0/domains/example.net + 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 'DELETE' + uri: http://localhost:9001/3.0/domains/example.org + 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 'DELETE' + uri: http://localhost:9001/3.0/domains/your.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": "\"aa8770f902ca0dad27dfd5e88a1841a4c1531810\"", "is_server_owner": + false, "self_link": "http://localhost:9001/3.0/users/2568", "user_id": 2568}, + {"created_on": "2005-08-01T07:49:23", "http_etag": "\"2654dd9289836cf68b2608957880cde5da86e8c2\"", + "is_server_owner": false, "self_link": "http://localhost:9001/3.0/users/2569", + "user_id": 2569}, {"created_on": "2005-08-01T07:49:23", "http_etag": "\"223506b993d7e04dc617c384eeb77461c7749dff\"", + "is_server_owner": false, "self_link": "http://localhost:9001/3.0/users/2580", + "user_id": 2580}, {"created_on": "2005-08-01T07:49:23", "http_etag": "\"aa7513fa55cc62c9d733aa5b931cc497810c6631\"", + "is_server_owner": false, "self_link": "http://localhost:9001/3.0/users/2581", + "user_id": 2581}, {"created_on": "2005-08-01T07:49:23", "http_etag": "\"668c2ec8b4864cea88abd8ddd087fa6cfb0356ce\"", + "is_server_owner": false, "self_link": "http://localhost:9001/3.0/users/2582", + "user_id": 2582}, {"created_on": "2005-08-01T07:49:23", "display_name": "Dave + Person", "http_etag": "\"a287a9e4977d07563fc1eaaa75afebd06401e790\"", "is_server_owner": + false, "password": "$6$rounds=681319$eO2clXJM58s3gOxm$Alpuibs7epqwFp8GCyK/k7egEUeBApu/59rJiL5i14pUdjrQVE1n3m8Y9pysiw9TwRyVYCVGR/OQT.WuK1OWK1", + "self_link": "http://localhost:9001/3.0/users/2587", "user_id": 2587}, {"created_on": + "2005-08-01T07:49:23", "display_name": "Elly Person", "http_etag": "\"d1ffb270e5d16fa37d28b0e4111cf616dd60356d\"", + "is_server_owner": false, "password": "$6$rounds=624384$OdUJXTpTIQc6m59K$mQI7ucB.iYcCykBOJfSl5qi/Z03w33JYGBN4NaL/T2tFoHyXZMQfDPntXjEuXJy.rfa0qJLntBzxcZR9W9KiC.", + "self_link": "http://localhost:9001/3.0/users/2588", "user_id": 2588}, {"created_on": + "2005-08-01T07:49:23", "display_name": "Gwen Person", "http_etag": "\"bec5ffb740c09d3e762df7f0cdb9305e0d387fd8\"", + "is_server_owner": true, "password": "$6$rounds=596969$A4ggUrP0senuLkXj$bNtPAxyzjxhpaTEQz20flvmB4Cy5oaxy1GL.KXiN99Dyc3mQpzPtiVScPxaQgd435VGoXcvG82tUhlkg8oXNm/", + "self_link": "http://localhost:9001/3.0/users/2589", "user_id": 2589}, {"created_on": + "2005-08-01T07:49:23", "display_name": "Herb Person", "http_etag": "\"e84961f5b0f9c35088de0fb978e211837b917038\"", + "is_server_owner": false, "password": "$6$rounds=633984$WXWlhWBAmeaSxlNn$HXr4dBquDZnGnnmuMUTGIi.53hVXyrjhrIg/JrnNPPGel9uEaH02MP7l/QkLtKL9ozD3016FrW/ywRYMZDWI.0", + "self_link": "http://localhost:9001/3.0/users/2590", "user_id": 2590}, {"created_on": + "2005-08-01T07:49:23", "http_etag": "\"0a9d7a56e2efeb7142d245b84c85bf3b13efec85\"", + "is_server_owner": false, "self_link": "http://localhost:9001/3.0/users/2591", + "user_id": 2591}, {"created_on": "2005-08-01T07:49:23", "http_etag": "\"66bb81cab0c048684620f5246d9ff44b0b23d86c\"", + "is_server_owner": false, "self_link": "http://localhost:9001/3.0/users/2592", + "user_id": 2592}, {"created_on": "2005-08-01T07:49:23", "http_etag": "\"01028cf2252303ed31683073cf13726312408108\"", + "is_server_owner": false, "password": "$6$rounds=662618$6xrZ4rQrBB8hSzaL$RdA1Z9Q95E7DOH10vz0rB5Vzrorluw.BWbPJmt2cZ2Mc3yDOGo6r1wJrtgaiG5p4jU/hrMkuqnfUpi0MjAorW/", + "self_link": "http://localhost:9001/3.0/users/2603", "user_id": 2603}], "http_etag": + "\"0e96e847fe033cfbdb9c7eb64aab812270ccc370\"", "start": 0, "total_size": + 12}'} + headers: + content-length: ['3259'] + 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/2568 + 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 'DELETE' + uri: http://localhost:9001/3.0/users/2569 + 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 'DELETE' + uri: http://localhost:9001/3.0/users/2580 + 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 'DELETE' + uri: http://localhost:9001/3.0/users/2581 + 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 'DELETE' + uri: http://localhost:9001/3.0/users/2582 + 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 'DELETE' + uri: http://localhost:9001/3.0/users/2587 + 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 'DELETE' + uri: http://localhost:9001/3.0/users/2588 + 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 'DELETE' + uri: http://localhost:9001/3.0/users/2589 + 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 'DELETE' + uri: http://localhost:9001/3.0/users/2590 + 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 'DELETE' + uri: http://localhost:9001/3.0/users/2591 + 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 'DELETE' + uri: http://localhost:9001/3.0/users/2592 + 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 'DELETE' + uri: http://localhost:9001/3.0/users/2603 + 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/ListMembersOptionsTest.test_page_accessible_for_owner.yaml b/src/postorius/tests/fixtures/vcr_cassettes/ListMembersOptionsTest.test_page_accessible_for_owner.yaml new file mode 100644 index 0000000..b405e44 --- /dev/null +++ b/src/postorius/tests/fixtures/vcr_cassettes/ListMembersOptionsTest.test_page_accessible_for_owner.yaml @@ -0,0 +1,372 @@ +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=foo%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/foo.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/foo.example.com + response: + body: {string: !!python/unicode '{"display_name": "Foo", "fqdn_listname": "foo@example.com", + "http_etag": "\"698a819bbb6b902096a8c5543cc7fac2328960d5\"", "list_id": "foo.example.com", + "list_name": "foo", "mail_host": "example.com", "member_count": 0, "self_link": + "http://localhost:9001/3.0/lists/foo.example.com", "volume": 1}'} + headers: + content-length: ['294'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: list_id=foo.example.com&role=owner&subscriber=owner%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/4583'] + status: {code: 201, message: Created} +- request: + body: list_id=foo.example.com&role=moderator&subscriber=moderator%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/4584'] + status: {code: 201, message: Created} +- 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/2606'] + status: {code: 201, message: Created} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/users/2606 + response: + body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": + "\"22ea12a200ab0ec16bd6539694c2c43c8baa831f\"", "is_server_owner": false, + "password": "$6$rounds=592740$GhFSxGf/D.JuEMlm$EHqGxzCqkZJy70pC5QCEAmgVdeFLZ.MaNHWXjVBZM2/agUE/jTWXiIXC.B6lJMB/a5KASUA8Eg6ZIxuyIIomG0", + "self_link": "http://localhost:9001/3.0/users/2606", "user_id": 2606}'} + headers: + content-length: ['330'] + 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/2606/addresses + response: + body: {string: !!python/unicode '{"entries": [{"email": "test@example.com", "http_etag": + "\"0cf7f7537b8386dc0366e045de413ba99cbcd994\"", "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/2606"}], "http_etag": "\"c3138b56102ee3c7307dc4c05ac4fb46f92ae07e\"", + "start": 0, "total_size": 1}'} + headers: + content-length: ['390'] + 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/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=foo.example.com&pre_approved=True&pre_confirmed=True&pre_verified=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/4585'] + status: {code: 201, message: Created} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/users/owner@example.com + response: + body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": + "\"603f74b10f4ed40a9fecc9e81e6540c6ea6599de\"", "is_server_owner": false, + "self_link": "http://localhost:9001/3.0/users/2604", "user_id": 2604}'} + headers: + content-length: ['194'] + 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/2604/addresses + response: + body: {string: !!python/unicode '{"entries": [{"email": "owner@example.com", "http_etag": + "\"618e31d1f8dc3d0198606c518e137335697251a0\"", "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/2604"}], "http_etag": "\"de936bc8dad370bf5d8d00ce9955c3555aa5e09f\"", + "start": 0, "total_size": 1}'} + headers: + content-length: ['393'] + 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/foo.example.com + response: + body: {string: !!python/unicode '{"display_name": "Foo", "fqdn_listname": "foo@example.com", + "http_etag": "\"98cc998d4a30293ec17da639bce10617912a6e1e\"", "list_id": "foo.example.com", + "list_name": "foo", "mail_host": "example.com", "member_count": 1, "self_link": + "http://localhost:9001/3.0/lists/foo.example.com", "volume": 1}'} + headers: + content-length: ['294'] + 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/foo.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": "\"244d66ca9fc48d0a5132a6d9d22f31923ad73c15\"", + "list_id": "foo.example.com", "member_id": 4583, "moderation_action": "accept", + "role": "owner", "self_link": "http://localhost:9001/3.0/members/4583", "user": + "http://localhost:9001/3.0/users/2604"}], "http_etag": "\"645065ef66e69dfde1af5cd5a19f5f70edf8ce5c\"", + "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/foo.example.com/roster/moderator + response: + body: {string: !!python/unicode '{"entries": [{"address": "http://localhost:9001/3.0/addresses/moderator@example.com", + "delivery_mode": "regular", "email": "moderator@example.com", "http_etag": + "\"af44ee1e674d4d899f02528d43e381fbefd9bc89\"", "list_id": "foo.example.com", + "member_id": 4584, "moderation_action": "accept", "role": "moderator", "self_link": + "http://localhost:9001/3.0/members/4584", "user": "http://localhost:9001/3.0/users/2605"}], + "http_etag": "\"f4781ed9c09601404f5e797264420fcbef476a27\"", "start": 0, "total_size": + 1}'} + headers: + content-length: ['504'] + 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/foo.example.com + response: + body: {string: !!python/unicode '{"display_name": "Foo", "fqdn_listname": "foo@example.com", + "http_etag": "\"98cc998d4a30293ec17da639bce10617912a6e1e\"", "list_id": "foo.example.com", + "list_name": "foo", "mail_host": "example.com", "member_count": 1, "self_link": + "http://localhost:9001/3.0/lists/foo.example.com", "volume": 1}'} + headers: + content-length: ['294'] + 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/foo.example.com + response: + body: {string: !!python/unicode '{"display_name": "Foo", "fqdn_listname": "foo@example.com", + "http_etag": "\"98cc998d4a30293ec17da639bce10617912a6e1e\"", "list_id": "foo.example.com", + "list_name": "foo", "mail_host": "example.com", "member_count": 1, "self_link": + "http://localhost:9001/3.0/lists/foo.example.com", "volume": 1}'} + headers: + content-length: ['294'] + 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/foo.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": "\"85368e96033fe3cdf8ff868afea6b320647b13c4\"", + "list_id": "foo.example.com", "member_id": 4585, "moderation_action": "defer", + "role": "member", "self_link": "http://localhost:9001/3.0/members/4585", "user": + "http://localhost:9001/3.0/users/2606"}'} + 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 'GET' + uri: http://localhost:9001/3.0/members/4585/preferences + response: + body: {string: !!python/unicode '{"http_etag": "\"99f1ebb90d41016f39dd1581700bd794ffe8b8e4\"", + "self_link": "http://localhost:9001/3.0/members/4585/preferences"}'} + headers: + content-length: ['128'] + 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": "\"603f74b10f4ed40a9fecc9e81e6540c6ea6599de\"", "is_server_owner": + false, "self_link": "http://localhost:9001/3.0/users/2604", "user_id": 2604}, + {"created_on": "2005-08-01T07:49:23", "http_etag": "\"5ad5052034de55092e6e401be1af4e0d607be467\"", + "is_server_owner": false, "self_link": "http://localhost:9001/3.0/users/2605", + "user_id": 2605}, {"created_on": "2005-08-01T07:49:23", "http_etag": "\"22ea12a200ab0ec16bd6539694c2c43c8baa831f\"", + "is_server_owner": false, "password": "$6$rounds=592740$GhFSxGf/D.JuEMlm$EHqGxzCqkZJy70pC5QCEAmgVdeFLZ.MaNHWXjVBZM2/agUE/jTWXiIXC.B6lJMB/a5KASUA8Eg6ZIxuyIIomG0", + "self_link": "http://localhost:9001/3.0/users/2606", "user_id": 2606}], "http_etag": + "\"f01e11defd61036ab180f55ffbcabc2bc17d8411\"", "start": 0, "total_size": + 3}'} + headers: + content-length: ['827'] + 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/2604 + 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 'DELETE' + uri: http://localhost:9001/3.0/users/2605 + 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 'DELETE' + uri: http://localhost:9001/3.0/users/2606 + 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/ListMembersOptionsTest.test_page_accessible_for_superuser.yaml b/src/postorius/tests/fixtures/vcr_cassettes/ListMembersOptionsTest.test_page_accessible_for_superuser.yaml new file mode 100644 index 0000000..7802ed6 --- /dev/null +++ b/src/postorius/tests/fixtures/vcr_cassettes/ListMembersOptionsTest.test_page_accessible_for_superuser.yaml @@ -0,0 +1,304 @@ +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=foo%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/foo.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/foo.example.com + response: + body: {string: !!python/unicode '{"display_name": "Foo", "fqdn_listname": "foo@example.com", + "http_etag": "\"698a819bbb6b902096a8c5543cc7fac2328960d5\"", "list_id": "foo.example.com", + "list_name": "foo", "mail_host": "example.com", "member_count": 0, "self_link": + "http://localhost:9001/3.0/lists/foo.example.com", "volume": 1}'} + headers: + content-length: ['294'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: list_id=foo.example.com&role=owner&subscriber=owner%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/4586'] + status: {code: 201, message: Created} +- request: + body: list_id=foo.example.com&role=moderator&subscriber=moderator%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/4587'] + status: {code: 201, message: Created} +- 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/2609'] + status: {code: 201, message: Created} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/users/2609 + response: + body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": + "\"4b4075c4ce76bfca6a0ec15694426f263188b6ad\"", "is_server_owner": false, + "password": "$6$rounds=619999$kqmF6jxKXqF9AfSt$opfAIBt9Y8UTNF9X3wfrLGDlLQFn4mlZQf52Ya5GOjy1xvLsDefq8rP8.TK1keMArFQ/33szPXXLndGwofF0V1", + "self_link": "http://localhost:9001/3.0/users/2609", "user_id": 2609}'} + headers: + content-length: ['330'] + 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/2609/addresses + response: + body: {string: !!python/unicode '{"entries": [{"email": "test@example.com", "http_etag": + "\"c0868c33abd342e340b9b8d4d4f52ae32cb5e48f\"", "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/2609"}], "http_etag": "\"49778316c189c9c5f4389deb15349becf65261ea\"", + "start": 0, "total_size": 1}'} + headers: + content-length: ['390'] + 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/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=foo.example.com&pre_approved=True&pre_confirmed=True&pre_verified=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/4588'] + status: {code: 201, message: Created} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/users/su@example.com + response: + body: {string: !!python/unicode '404 Not Found'} + headers: + content-length: ['13'] + content-type: [application/json; charset=utf-8] + 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/foo.example.com + response: + body: {string: !!python/unicode '{"display_name": "Foo", "fqdn_listname": "foo@example.com", + "http_etag": "\"98cc998d4a30293ec17da639bce10617912a6e1e\"", "list_id": "foo.example.com", + "list_name": "foo", "mail_host": "example.com", "member_count": 1, "self_link": + "http://localhost:9001/3.0/lists/foo.example.com", "volume": 1}'} + headers: + content-length: ['294'] + 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/foo.example.com + response: + body: {string: !!python/unicode '{"display_name": "Foo", "fqdn_listname": "foo@example.com", + "http_etag": "\"98cc998d4a30293ec17da639bce10617912a6e1e\"", "list_id": "foo.example.com", + "list_name": "foo", "mail_host": "example.com", "member_count": 1, "self_link": + "http://localhost:9001/3.0/lists/foo.example.com", "volume": 1}'} + headers: + content-length: ['294'] + 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/foo.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": "\"73b340a57ed1411204c8922abf81cedbdcd75b5d\"", + "list_id": "foo.example.com", "member_id": 4588, "moderation_action": "defer", + "role": "member", "self_link": "http://localhost:9001/3.0/members/4588", "user": + "http://localhost:9001/3.0/users/2609"}'} + 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 'GET' + uri: http://localhost:9001/3.0/members/4588/preferences + response: + body: {string: !!python/unicode '{"http_etag": "\"caf20559435fb7e0fc0bd9d70ac3f6e98a5a17cd\"", + "self_link": "http://localhost:9001/3.0/members/4588/preferences"}'} + headers: + content-length: ['128'] + 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": "\"59a4e036e3acede27869483a1bbbe9413fadb703\"", "is_server_owner": + false, "self_link": "http://localhost:9001/3.0/users/2607", "user_id": 2607}, + {"created_on": "2005-08-01T07:49:23", "http_etag": "\"e1a7ef501eb310e42acda39d402a3ad96588b032\"", + "is_server_owner": false, "self_link": "http://localhost:9001/3.0/users/2608", + "user_id": 2608}, {"created_on": "2005-08-01T07:49:23", "http_etag": "\"4b4075c4ce76bfca6a0ec15694426f263188b6ad\"", + "is_server_owner": false, "password": "$6$rounds=619999$kqmF6jxKXqF9AfSt$opfAIBt9Y8UTNF9X3wfrLGDlLQFn4mlZQf52Ya5GOjy1xvLsDefq8rP8.TK1keMArFQ/33szPXXLndGwofF0V1", + "self_link": "http://localhost:9001/3.0/users/2609", "user_id": 2609}], "http_etag": + "\"18c62ebe7bdc4e1f14e968297d0a8c8e1cfd05a8\"", "start": 0, "total_size": + 3}'} + headers: + content-length: ['827'] + 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/2607 + 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 'DELETE' + uri: http://localhost:9001/3.0/users/2608 + 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 'DELETE' + uri: http://localhost:9001/3.0/users/2609 + 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/ListMembersOptionsTest.test_page_not_accessible_for_unprivileged_users.yaml b/src/postorius/tests/fixtures/vcr_cassettes/ListMembersOptionsTest.test_page_not_accessible_for_unprivileged_users.yaml new file mode 100644 index 0000000..77de007 --- /dev/null +++ b/src/postorius/tests/fixtures/vcr_cassettes/ListMembersOptionsTest.test_page_not_accessible_for_unprivileged_users.yaml @@ -0,0 +1,315 @@ +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=foo%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/foo.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/foo.example.com + response: + body: {string: !!python/unicode '{"display_name": "Foo", "fqdn_listname": "foo@example.com", + "http_etag": "\"698a819bbb6b902096a8c5543cc7fac2328960d5\"", "list_id": "foo.example.com", + "list_name": "foo", "mail_host": "example.com", "member_count": 0, "self_link": + "http://localhost:9001/3.0/lists/foo.example.com", "volume": 1}'} + headers: + content-length: ['294'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: list_id=foo.example.com&role=owner&subscriber=owner%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/4589'] + status: {code: 201, message: Created} +- request: + body: list_id=foo.example.com&role=moderator&subscriber=moderator%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/4590'] + status: {code: 201, message: Created} +- 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/2612'] + status: {code: 201, message: Created} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/users/2612 + response: + body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": + "\"708ef604f84d384f1d7cfbc229926f3173eff543\"", "is_server_owner": false, + "password": "$6$rounds=607783$i14H5eib631hoRwN$38xYdx4aYhBal.qrN2nQbPBKnffLTJb/4X7nRlodE.lAvDpNEQnNNRITnXPNlkLl2eL70l5COpf5vAghG5Td6/", + "self_link": "http://localhost:9001/3.0/users/2612", "user_id": 2612}'} + headers: + content-length: ['330'] + 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/2612/addresses + response: + body: {string: !!python/unicode '{"entries": [{"email": "test@example.com", "http_etag": + "\"f400325071fe0a882cb73dbbe4240164312a1756\"", "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/2612"}], "http_etag": "\"93d9fb86dbb975810fc1c33e7b3aca06e5099575\"", + "start": 0, "total_size": 1}'} + headers: + content-length: ['390'] + 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/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=foo.example.com&pre_approved=True&pre_confirmed=True&pre_verified=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/4591'] + status: {code: 201, message: Created} +- 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": + "\"708ef604f84d384f1d7cfbc229926f3173eff543\"", "is_server_owner": false, + "password": "$6$rounds=607783$i14H5eib631hoRwN$38xYdx4aYhBal.qrN2nQbPBKnffLTJb/4X7nRlodE.lAvDpNEQnNNRITnXPNlkLl2eL70l5COpf5vAghG5Td6/", + "self_link": "http://localhost:9001/3.0/users/2612", "user_id": 2612}'} + headers: + content-length: ['330'] + 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/2612/addresses + response: + body: {string: !!python/unicode '{"entries": [{"email": "test@example.com", "http_etag": + "\"22b7bbefdd8e6300f55edbaad06f45d889a35c4d\"", "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/2612", "verified_on": "2005-08-01T07:49:23"}], + "http_etag": "\"4c3e0e9c4b80a7fa8d66cc9922ccf8dacaaa0702\"", "start": 0, "total_size": + 1}'} + headers: + content-length: ['428'] + 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/foo.example.com + response: + body: {string: !!python/unicode '{"display_name": "Foo", "fqdn_listname": "foo@example.com", + "http_etag": "\"98cc998d4a30293ec17da639bce10617912a6e1e\"", "list_id": "foo.example.com", + "list_name": "foo", "mail_host": "example.com", "member_count": 1, "self_link": + "http://localhost:9001/3.0/lists/foo.example.com", "volume": 1}'} + headers: + content-length: ['294'] + 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/foo.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": "\"4d30cbf1f859cb5a83da2d77f49d8fb50f5f7420\"", + "list_id": "foo.example.com", "member_id": 4589, "moderation_action": "accept", + "role": "owner", "self_link": "http://localhost:9001/3.0/members/4589", "user": + "http://localhost:9001/3.0/users/2610"}], "http_etag": "\"88557a24364b6c9e172714fc9a0ef51d54ef17da\"", + "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/foo.example.com/roster/moderator + response: + body: {string: !!python/unicode '{"entries": [{"address": "http://localhost:9001/3.0/addresses/moderator@example.com", + "delivery_mode": "regular", "email": "moderator@example.com", "http_etag": + "\"b6ee7365a660001ef272004ae1248f94dc9c7523\"", "list_id": "foo.example.com", + "member_id": 4590, "moderation_action": "accept", "role": "moderator", "self_link": + "http://localhost:9001/3.0/members/4590", "user": "http://localhost:9001/3.0/users/2611"}], + "http_etag": "\"7fc0479dfcfa9296f6ef6faf17bb6467d0f14d3c\"", "start": 0, "total_size": + 1}'} + headers: + content-length: ['504'] + 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": "\"59837947ccfaf5c271f4d5fb21e7c1cf011b272f\"", "is_server_owner": + false, "self_link": "http://localhost:9001/3.0/users/2610", "user_id": 2610}, + {"created_on": "2005-08-01T07:49:23", "http_etag": "\"d7c50d476e69848f5433854c54088aa32074a18d\"", + "is_server_owner": false, "self_link": "http://localhost:9001/3.0/users/2611", + "user_id": 2611}, {"created_on": "2005-08-01T07:49:23", "http_etag": "\"708ef604f84d384f1d7cfbc229926f3173eff543\"", + "is_server_owner": false, "password": "$6$rounds=607783$i14H5eib631hoRwN$38xYdx4aYhBal.qrN2nQbPBKnffLTJb/4X7nRlodE.lAvDpNEQnNNRITnXPNlkLl2eL70l5COpf5vAghG5Td6/", + "self_link": "http://localhost:9001/3.0/users/2612", "user_id": 2612}], "http_etag": + "\"f8d6e982ff405062fbb2bdebb1999af0e8293834\"", "start": 0, "total_size": + 3}'} + headers: + content-length: ['827'] + 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/2610 + 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 'DELETE' + uri: http://localhost:9001/3.0/users/2611 + 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 'DELETE' + uri: http://localhost:9001/3.0/users/2612 + 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/ListMembersOptionsTest.test_page_not_accessible_if_not_logged_in.yaml b/src/postorius/tests/fixtures/vcr_cassettes/ListMembersOptionsTest.test_page_not_accessible_if_not_logged_in.yaml new file mode 100644 index 0000000..cc175bd --- /dev/null +++ b/src/postorius/tests/fixtures/vcr_cassettes/ListMembersOptionsTest.test_page_not_accessible_if_not_logged_in.yaml @@ -0,0 +1,233 @@ +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=foo%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/foo.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/foo.example.com + response: + body: {string: !!python/unicode '{"display_name": "Foo", "fqdn_listname": "foo@example.com", + "http_etag": "\"698a819bbb6b902096a8c5543cc7fac2328960d5\"", "list_id": "foo.example.com", + "list_name": "foo", "mail_host": "example.com", "member_count": 0, "self_link": + "http://localhost:9001/3.0/lists/foo.example.com", "volume": 1}'} + headers: + content-length: ['294'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: list_id=foo.example.com&role=owner&subscriber=owner%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/4592'] + status: {code: 201, message: Created} +- request: + body: list_id=foo.example.com&role=moderator&subscriber=moderator%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/4593'] + status: {code: 201, message: Created} +- 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/2615'] + status: {code: 201, message: Created} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/users/2615 + response: + body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": + "\"6391e4d99c1ed86c7e2038b737a4a08b4dbcf1af\"", "is_server_owner": false, + "password": "$6$rounds=646278$a6o1VjW.zq/0gyLy$oNuHrAQqj2jmKAJ.idVUKzKKWHxTQO6.HnyZHPeX4gJZlvwTBtGEgdY9A8ximHM1k/pECprdI2CiDL3WXGcbI0", + "self_link": "http://localhost:9001/3.0/users/2615", "user_id": 2615}'} + headers: + content-length: ['330'] + 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/2615/addresses + response: + body: {string: !!python/unicode '{"entries": [{"email": "test@example.com", "http_etag": + "\"0d0873ed918c580fea38c274cc97df68b013ca79\"", "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/2615"}], "http_etag": "\"7f2f3ef161bf541697fa1f2e29d450f799e73691\"", + "start": 0, "total_size": 1}'} + headers: + content-length: ['390'] + 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/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=foo.example.com&pre_approved=True&pre_confirmed=True&pre_verified=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/4594'] + status: {code: 201, message: Created} +- 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": "\"02338048f13405069664dd64cca65ab8266c3297\"", "is_server_owner": + false, "self_link": "http://localhost:9001/3.0/users/2613", "user_id": 2613}, + {"created_on": "2005-08-01T07:49:23", "http_etag": "\"7d0624c8804cefe27f10c0a6e163b01035403fed\"", + "is_server_owner": false, "self_link": "http://localhost:9001/3.0/users/2614", + "user_id": 2614}, {"created_on": "2005-08-01T07:49:23", "http_etag": "\"6391e4d99c1ed86c7e2038b737a4a08b4dbcf1af\"", + "is_server_owner": false, "password": "$6$rounds=646278$a6o1VjW.zq/0gyLy$oNuHrAQqj2jmKAJ.idVUKzKKWHxTQO6.HnyZHPeX4gJZlvwTBtGEgdY9A8ximHM1k/pECprdI2CiDL3WXGcbI0", + "self_link": "http://localhost:9001/3.0/users/2615", "user_id": 2615}], "http_etag": + "\"7b1da78e2a459106585efb95a3c957e8ea8e7421\"", "start": 0, "total_size": + 3}'} + headers: + content-length: ['827'] + 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/2613 + 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 'DELETE' + uri: http://localhost:9001/3.0/users/2614 + 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 'DELETE' + uri: http://localhost:9001/3.0/users/2615 + 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/MailmanUserTest.test_presence_of_form_in_user_global_settings.yaml b/src/postorius/tests/fixtures/vcr_cassettes/MailmanUserTest.test_presence_of_form_in_user_global_settings.yaml new file mode 100644 index 0000000..86259f7 --- /dev/null +++ b/src/postorius/tests/fixtures/vcr_cassettes/MailmanUserTest.test_presence_of_form_in_user_global_settings.yaml @@ -0,0 +1,201 @@ +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=foo%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/foo.example.com'] + status: {code: 201, message: Created} +- request: + body: email=user%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/2621'] + status: {code: 201, message: Created} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/users/user@example.com + response: + body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": + "\"b7a850acd310d62e9e603a618f30b1e40f256606\"", "is_server_owner": false, + "password": "$6$rounds=681028$XHeL.4KvaJFxIFJU$xEXFeosUxSAwyHUqIoXmShKEhMuhucO5ZivjtMO.ZdqjWjYtaTtCzCkf0xW5MIJ38INR.gmszsfKtvYQjGW1c.", + "self_link": "http://localhost:9001/3.0/users/2621", "user_id": 2621}'} + headers: + content-length: ['330'] + 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/2621/addresses + response: + body: {string: !!python/unicode '{"entries": [{"email": "user@example.com", "http_etag": + "\"947d8347885b3d4a30b1d7e550aa0de8b58c4fbd\"", "original_email": "user@example.com", + "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/user@example.com", + "user": "http://localhost:9001/3.0/users/2621"}], "http_etag": "\"ea201a77c0b60223ff4e3fa9fa45df3281a4cf75\"", + "start": 0, "total_size": 1}'} + headers: + content-length: ['390'] + 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/user@example.com + response: + body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": + "\"b7a850acd310d62e9e603a618f30b1e40f256606\"", "is_server_owner": false, + "password": "$6$rounds=681028$XHeL.4KvaJFxIFJU$xEXFeosUxSAwyHUqIoXmShKEhMuhucO5ZivjtMO.ZdqjWjYtaTtCzCkf0xW5MIJ38INR.gmszsfKtvYQjGW1c.", + "self_link": "http://localhost:9001/3.0/users/2621", "user_id": 2621}'} + headers: + content-length: ['330'] + 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/2621/addresses + response: + body: {string: !!python/unicode '{"entries": [{"email": "user@example.com", "http_etag": + "\"947d8347885b3d4a30b1d7e550aa0de8b58c4fbd\"", "original_email": "user@example.com", + "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/user@example.com", + "user": "http://localhost:9001/3.0/users/2621"}], "http_etag": "\"ea201a77c0b60223ff4e3fa9fa45df3281a4cf75\"", + "start": 0, "total_size": 1}'} + headers: + content-length: ['390'] + 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/user@example.com + response: + body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": + "\"b7a850acd310d62e9e603a618f30b1e40f256606\"", "is_server_owner": false, + "password": "$6$rounds=681028$XHeL.4KvaJFxIFJU$xEXFeosUxSAwyHUqIoXmShKEhMuhucO5ZivjtMO.ZdqjWjYtaTtCzCkf0xW5MIJ38INR.gmszsfKtvYQjGW1c.", + "self_link": "http://localhost:9001/3.0/users/2621", "user_id": 2621}'} + headers: + content-length: ['330'] + 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/2621/preferences + response: + body: {string: !!python/unicode '{"http_etag": "\"2db584a9a1c66e633ca0c11c813f1a72a26999cb\"", + "self_link": "http://localhost:9001/3.0/users/2621/preferences"}'} + headers: + content-length: ['126'] + 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": "\"b7a850acd310d62e9e603a618f30b1e40f256606\"", "is_server_owner": + false, "password": "$6$rounds=681028$XHeL.4KvaJFxIFJU$xEXFeosUxSAwyHUqIoXmShKEhMuhucO5ZivjtMO.ZdqjWjYtaTtCzCkf0xW5MIJ38INR.gmszsfKtvYQjGW1c.", + "self_link": "http://localhost:9001/3.0/users/2621", "user_id": 2621}], "http_etag": + "\"6697ff9065ffa70c4cee3d57515adcd5604dcf42\"", "start": 0, "total_size": + 1}'} + headers: + content-length: ['435'] + 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/2621 + 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/MailmanUserTest.test_presence_of_form_in_user_list_options.yaml b/src/postorius/tests/fixtures/vcr_cassettes/MailmanUserTest.test_presence_of_form_in_user_list_options.yaml new file mode 100644 index 0000000..cb573fd --- /dev/null +++ b/src/postorius/tests/fixtures/vcr_cassettes/MailmanUserTest.test_presence_of_form_in_user_list_options.yaml @@ -0,0 +1,249 @@ +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=foo%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/foo.example.com'] + status: {code: 201, message: Created} +- request: + body: email=user%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/2622'] + status: {code: 201, message: Created} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/lists/foo.example.com + response: + body: {string: !!python/unicode '{"display_name": "Foo", "fqdn_listname": "foo@example.com", + "http_etag": "\"698a819bbb6b902096a8c5543cc7fac2328960d5\"", "list_id": "foo.example.com", + "list_name": "foo", "mail_host": "example.com", "member_count": 0, "self_link": + "http://localhost:9001/3.0/lists/foo.example.com", "volume": 1}'} + headers: + content-length: ['294'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: display_name=None&list_id=foo.example.com&pre_approved=True&pre_confirmed=True&pre_verified=True&subscriber=user%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/4597'] + status: {code: 201, message: Created} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/users/user@example.com + response: + body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": + "\"ad800a1b557c942a74002421352ad637ef54361d\"", "is_server_owner": false, + "password": "$6$rounds=668522$Zz437QzE97T.VyQt$2uk3VYKY.4pMLNS1JhszPNREjjBMLU8kPbjsQkabxEdpXsMx430oO4gffBs2jTCnjrK4UmeHkWGJqyomXyR3e0", + "self_link": "http://localhost:9001/3.0/users/2622", "user_id": 2622}'} + headers: + content-length: ['330'] + 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/2622/addresses + response: + body: {string: !!python/unicode '{"entries": [{"email": "user@example.com", "http_etag": + "\"aae2dc671b053efd6f2a35396be2e1d0b6cf5a49\"", "original_email": "user@example.com", + "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/user@example.com", + "user": "http://localhost:9001/3.0/users/2622", "verified_on": "2005-08-01T07:49:23"}], + "http_etag": "\"a7855ef58c95002a41df1bebfd6e00938f31add5\"", "start": 0, "total_size": + 1}'} + headers: + content-length: ['428'] + 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/foo.example.com + response: + body: {string: !!python/unicode '{"display_name": "Foo", "fqdn_listname": "foo@example.com", + "http_etag": "\"98cc998d4a30293ec17da639bce10617912a6e1e\"", "list_id": "foo.example.com", + "list_name": "foo", "mail_host": "example.com", "member_count": 1, "self_link": + "http://localhost:9001/3.0/lists/foo.example.com", "volume": 1}'} + headers: + content-length: ['294'] + 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/user@example.com + response: + body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": + "\"ad800a1b557c942a74002421352ad637ef54361d\"", "is_server_owner": false, + "password": "$6$rounds=668522$Zz437QzE97T.VyQt$2uk3VYKY.4pMLNS1JhszPNREjjBMLU8kPbjsQkabxEdpXsMx430oO4gffBs2jTCnjrK4UmeHkWGJqyomXyR3e0", + "self_link": "http://localhost:9001/3.0/users/2622", "user_id": 2622}'} + headers: + content-length: ['330'] + 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/2622/addresses + response: + body: {string: !!python/unicode '{"entries": [{"email": "user@example.com", "http_etag": + "\"aae2dc671b053efd6f2a35396be2e1d0b6cf5a49\"", "original_email": "user@example.com", + "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/user@example.com", + "user": "http://localhost:9001/3.0/users/2622", "verified_on": "2005-08-01T07:49:23"}], + "http_etag": "\"a7855ef58c95002a41df1bebfd6e00938f31add5\"", "start": 0, "total_size": + 1}'} + headers: + content-length: ['428'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: subscriber=user%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/find + response: + body: {string: !!python/unicode '{"entries": [{"address": "http://localhost:9001/3.0/addresses/user@example.com", + "delivery_mode": "regular", "email": "user@example.com", "http_etag": "\"e851b50bc753c29b8dc7c780b9ddf936fd8d691d\"", + "list_id": "foo.example.com", "member_id": 4597, "moderation_action": "defer", + "role": "member", "self_link": "http://localhost:9001/3.0/members/4597", "user": + "http://localhost:9001/3.0/users/2622"}], "http_etag": "\"0af9a069478e96700f8edf174e01eeb73ce00f78\"", + "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/members/4597/preferences + response: + body: {string: !!python/unicode '{"http_etag": "\"fa5eef4cab3cebc46090e039de496e19eb825609\"", + "self_link": "http://localhost:9001/3.0/members/4597/preferences"}'} + headers: + content-length: ['128'] + 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": "\"ad800a1b557c942a74002421352ad637ef54361d\"", "is_server_owner": + false, "password": "$6$rounds=668522$Zz437QzE97T.VyQt$2uk3VYKY.4pMLNS1JhszPNREjjBMLU8kPbjsQkabxEdpXsMx430oO4gffBs2jTCnjrK4UmeHkWGJqyomXyR3e0", + "self_link": "http://localhost:9001/3.0/users/2622", "user_id": 2622}], "http_etag": + "\"ba378435678523b8994e039fb8204ebd930d7851\"", "start": 0, "total_size": + 1}'} + headers: + content-length: ['435'] + 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/2622 + 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/MailmanUserTest.test_presence_of_form_in_user_subscription_preferences.yaml b/src/postorius/tests/fixtures/vcr_cassettes/MailmanUserTest.test_presence_of_form_in_user_subscription_preferences.yaml new file mode 100644 index 0000000..d14f254 --- /dev/null +++ b/src/postorius/tests/fixtures/vcr_cassettes/MailmanUserTest.test_presence_of_form_in_user_subscription_preferences.yaml @@ -0,0 +1,251 @@ +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=foo%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/foo.example.com'] + status: {code: 201, message: Created} +- request: + body: email=user%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/2623'] + status: {code: 201, message: Created} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/lists/foo.example.com + response: + body: {string: !!python/unicode '{"display_name": "Foo", "fqdn_listname": "foo@example.com", + "http_etag": "\"698a819bbb6b902096a8c5543cc7fac2328960d5\"", "list_id": "foo.example.com", + "list_name": "foo", "mail_host": "example.com", "member_count": 0, "self_link": + "http://localhost:9001/3.0/lists/foo.example.com", "volume": 1}'} + headers: + content-length: ['294'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: display_name=None&list_id=foo.example.com&pre_approved=True&pre_confirmed=True&pre_verified=True&subscriber=user%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/4598'] + status: {code: 201, message: Created} +- request: + body: null + headers: + accept-encoding: ['gzip, deflate'] + method: !!python/unicode 'GET' + uri: http://localhost:9001/3.0/users/user@example.com + response: + body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": + "\"4fa1bb835cc391709a2d6676a4e58cfad0c544f3\"", "is_server_owner": false, + "password": "$6$rounds=603749$AeC1fWkD.7I/S1eD$EyYSUN6bka5vVksWqsYekgIe6K36ZTxv9sWzS8zEU.vEsP0/XKlChd5dtyu8TKMdU9.BwzJfOiJwCa03WvE6p.", + "self_link": "http://localhost:9001/3.0/users/2623", "user_id": 2623}'} + headers: + content-length: ['330'] + 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/2623/addresses + response: + body: {string: !!python/unicode '{"entries": [{"email": "user@example.com", "http_etag": + "\"e89a8e796d0dd2a63a852851fba793d4651f5b65\"", "original_email": "user@example.com", + "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/user@example.com", + "user": "http://localhost:9001/3.0/users/2623", "verified_on": "2005-08-01T07:49:23"}], + "http_etag": "\"f3d1f02cccdb607395371f187704957e6a069da7\"", "start": 0, "total_size": + 1}'} + headers: + content-length: ['428'] + 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/user@example.com + response: + body: {string: !!python/unicode '{"created_on": "2005-08-01T07:49:23", "http_etag": + "\"4fa1bb835cc391709a2d6676a4e58cfad0c544f3\"", "is_server_owner": false, + "password": "$6$rounds=603749$AeC1fWkD.7I/S1eD$EyYSUN6bka5vVksWqsYekgIe6K36ZTxv9sWzS8zEU.vEsP0/XKlChd5dtyu8TKMdU9.BwzJfOiJwCa03WvE6p.", + "self_link": "http://localhost:9001/3.0/users/2623", "user_id": 2623}'} + headers: + content-length: ['330'] + 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/2623/addresses + response: + body: {string: !!python/unicode '{"entries": [{"email": "user@example.com", "http_etag": + "\"e89a8e796d0dd2a63a852851fba793d4651f5b65\"", "original_email": "user@example.com", + "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/user@example.com", + "user": "http://localhost:9001/3.0/users/2623", "verified_on": "2005-08-01T07:49:23"}], + "http_etag": "\"f3d1f02cccdb607395371f187704957e6a069da7\"", "start": 0, "total_size": + 1}'} + headers: + content-length: ['428'] + 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/2623/addresses + response: + body: {string: !!python/unicode '{"entries": [{"email": "user@example.com", "http_etag": + "\"e89a8e796d0dd2a63a852851fba793d4651f5b65\"", "original_email": "user@example.com", + "registered_on": "2005-08-01T07:49:23", "self_link": "http://localhost:9001/3.0/addresses/user@example.com", + "user": "http://localhost:9001/3.0/users/2623", "verified_on": "2005-08-01T07:49:23"}], + "http_etag": "\"f3d1f02cccdb607395371f187704957e6a069da7\"", "start": 0, "total_size": + 1}'} + headers: + content-length: ['428'] + content-type: [application/json; charset=utf-8] + status: {code: 200, message: OK} +- request: + body: subscriber=user%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/find + response: + body: {string: !!python/unicode '{"entries": [{"address": "http://localhost:9001/3.0/addresses/user@example.com", + "delivery_mode": "regular", "email": "user@example.com", "http_etag": "\"3efe9fa8c8ee80b12ab24eddc909b5ded4388872\"", + "list_id": "foo.example.com", "member_id": 4598, "moderation_action": "defer", + "role": "member", "self_link": "http://localhost:9001/3.0/members/4598", "user": + "http://localhost:9001/3.0/users/2623"}], "http_etag": "\"aa52ba493ad14089169d4feb6a04dfbaaf7a2579\"", + "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/members/4598/preferences + response: + body: {string: !!python/unicode '{"http_etag": "\"77bd926020df755765714a2e5812c6ddeadb8ed4\"", + "self_link": "http://localhost:9001/3.0/members/4598/preferences"}'} + headers: + content-length: ['128'] + 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": "\"4fa1bb835cc391709a2d6676a4e58cfad0c544f3\"", "is_server_owner": + false, "password": "$6$rounds=603749$AeC1fWkD.7I/S1eD$EyYSUN6bka5vVksWqsYekgIe6K36ZTxv9sWzS8zEU.vEsP0/XKlChd5dtyu8TKMdU9.BwzJfOiJwCa03WvE6p.", + "self_link": "http://localhost:9001/3.0/users/2623", "user_id": 2623}], "http_etag": + "\"365468462e937cd4cb449747fc48fbf878c1cd91\"", "start": 0, "total_size": + 1}'} + headers: + content-length: ['435'] + 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/2623 + response: + body: {string: !!python/unicode ''} + headers: + content-length: ['0'] + status: {code: 204, message: No Content} +version: 1