

@mock.patch('website.mailchimp_utils.mailchimp.Lists.list')
@mock.patch('website.mailchimp_utils.mailchimp.Lists.batch_subscribe')
def test_main(self, mock_subscribe, mock_list):
    mock_list.return_value = {
        'data': [{
            'id': 1,
            'list_name': GENERAL_LIST,
        }],
    }
    assert_false(self.user.mailchimp_mailing_lists)
    main(dry=False)
    assert_true(self.user.mailchimp_mailing_lists[GENERAL_LIST])
    mock_subscribe.assert_called()

dataset/ETHPy150Open CenterForOpenScience/osf.io/scripts/sync_email.py TestSyncEmail.test_main/original