

def test_clicks(self):
    min_date = '2010-01-01'
    self.campaign.stub_request(('campaigns/%s/clicks.json?date=%s&orderfield=date&page=1&pagesize=1000&orderdirection=asc' % (self.campaign_id, urllib.quote(min_date, ''))), 'campaign_clicks.json')
    clicks = self.campaign.clicks(min_date)
    self.assertEquals(len(clicks.Results), 3)
    self.assertEquals(clicks.Results[0].EmailAddress, 'subs+6576576576@example.com')
    self.assertEquals(clicks.Results[0].URL, 'http://video.google.com.au/?hl=en&tab=wv')
    self.assertEquals(clicks.Results[0].ListID, '512a3bc577a58fdf689c654329b50fa0')
    self.assertEquals(clicks.Results[0].Date, '2010-10-11 08:29:00')
    self.assertEquals(clicks.Results[0].IPAddress, '192.168.126.87')
    self.assertEquals(clicks.Results[0].Latitude, (- 33.8683))
    self.assertEquals(clicks.Results[0].Longitude, 151.2086)
    self.assertEquals(clicks.Results[0].City, 'Sydney')
    self.assertEquals(clicks.Results[0].Region, 'New South Wales')
    self.assertEquals(clicks.Results[0].CountryCode, 'AU')
    self.assertEquals(clicks.Results[0].CountryName, 'Australia')
    self.assertEquals(clicks.ResultsOrderedBy, 'date')
    self.assertEquals(clicks.OrderDirection, 'asc')
    self.assertEquals(clicks.PageNumber, 1)
    self.assertEquals(clicks.PageSize, 1000)
    self.assertEquals(clicks.RecordsOnThisPage, 3)
    self.assertEquals(clicks.TotalNumberOfRecords, 3)
    self.assertEquals(clicks.NumberOfPages, 1)

dataset/ETHPy150Open campaignmonitor/createsend-python/test/test_campaign.py CampaignTestCase.test_clicks/original