Re: [Mailman-Developers] Accessing the members of a list

Hi Aditya, Since a lot of Postorius code involves calls to Mailman's REST API and running these tests against a real instance would be painfully slow, hence ''vcrpy'' cassettess are used. These files contain pre-recorded HTTP responses. If you write new tests, it's advisable to add a separate fixture file for each test case. Considering your test, the fixture file that your test uses contains the following pre-recorded responses for the following POST requests : 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
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
request: body: display_name=None&list_id=foo.example.com&pre_approved=True&pre_confirmed=True&pre_verified=True&subscriber=member-1%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
request: body: display_name=None&list_id=foo.example.com&pre_approved=True&pre_confirmed=True&pre_verified=True&subscriber=member-2%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
So only these request formats can be used in your test. If you want to use other request formats then probably you have to record them in the following fixture file: src/postorius/tests/fixtures/vcr_cassettes/ListMembersTest.test_search_members_1.yaml
You can also refer to ''vcrpy'' documentation for more information.
Hope this helps.
Regards, Harshit Bansal.
On 2/24/16, Aditya Divekar <adityadivekar03@gmail.com> wrote:
participants (1)
-
Harshit Bansal