Esempio n. 1
0
    def test_mailchimp_locator_connect(self):
        setRoles(self.portal, TEST_USER_ID, ['Manager'])
        self.portal.invokeFactory(type_name='Campaign', id='c1')
        self.campaign = self.portal['c1']
        setRoles(self.portal, TEST_USER_ID, ['Member'])

        from redturtle.monkey.locator import MonkeyLocator
        locator = MonkeyLocator()
        locator.ping(campaign=self.campaign)
        self.assertFalse(locator.settings==self.campaign)

        # with proper api_key the settings are set
        self.campaign.setCampaign_api_key('abc')
        locator.ping(campaign=self.campaign)
        self.assertTrue(locator.settings==self.campaign)
Esempio n. 2
0
    def test_mailchimp_locator_connect(self):
        setRoles(self.portal, TEST_USER_ID, ['Manager'])
        self.portal.invokeFactory(type_name='Campaign', id='c1')
        self.campaign = self.portal['c1']
        setRoles(self.portal, TEST_USER_ID, ['Member'])

        from redturtle.monkey.locator import MonkeyLocator
        locator = MonkeyLocator()
        locator.ping(campaign=self.campaign)
        self.assertFalse(locator.settings == self.campaign)

        # with proper api_key the settings are set
        self.campaign.setCampaign_api_key('abc')
        locator.ping(campaign=self.campaign)
        self.assertTrue(locator.settings == self.campaign)
Esempio n. 3
0
 def test_mailchimp_locator_create_campaign(self):
     from redturtle.monkey.locator import MonkeyLocator
     locator = MonkeyLocator()
     web_id = locator.createCampaign('Title','Subject','List_id',
                                     'Template_id','The content')
     self.assertEqual(web_id, '123QWE456')
Esempio n. 4
0
 def test_mailchimp_locator_template_method(self):
     from redturtle.monkey.locator import MonkeyLocator
     locator = MonkeyLocator()
     self.assertTrue(locator.templates())
     self.assertEqual(len(locator.templates()), 2)
Esempio n. 5
0
 def test_mailchimp_locator_create_campaign(self):
     from redturtle.monkey.locator import MonkeyLocator
     locator = MonkeyLocator()
     web_id = locator.createCampaign('Title', 'Subject', 'List_id',
                                     'Template_id', 'The content')
     self.assertEqual(web_id, '123QWE456')
Esempio n. 6
0
 def test_mailchimp_locator_template_method(self):
     from redturtle.monkey.locator import MonkeyLocator
     locator = MonkeyLocator()
     self.assertTrue(locator.templates())
     self.assertEqual(len(locator.templates()), 2)