def test_parse_response(self): response_elements = parse_response(self.response) self.assertEqual(response_elements['total_matches'], 1) self.assertEqual(response_elements['total_pages'], 1) self.assertEqual(response_elements['page_number_requested'], 1) self.assertEqual(response_elements['categories'], self.response_elements['categories']) self.assertEqual(response_elements['promotion_types'],[{'id': 22, 'name': 'percentage off'}]) self.assertEqual(response_elements['merchant'], {'external_id': 0, 'name': 'Sample Advertiser Name'}) self.assertEqual(response_elements['network'], {'id': 1, 'name': 'Linkshare Network'}) self.assertEqual(response_elements['deal'], self.response_elements['deal'])
def test_parse_response(self): response_elements = parse_response(self.response) self.assertEqual(response_elements['total_matches'], 1) self.assertEqual(response_elements['total_pages'], 1) self.assertEqual(response_elements['page_number_requested'], 1) self.assertEqual(response_elements['categories'], [{'id': 983, 'name': 'computers'}, {'id': 12, 'name': 'electronics'}, {'id': 14, 'name': 'gifts'}]) self.assertEqual(response_elements['promotion_types'],[{'id': 22, 'name': 'percentage off'}]) self.assertEqual(response_elements['merchant'], {'external_id': 0, 'name': 'Sample Advertiser Name'}) self.assertEqual(response_elements['network'], {'id': 1, 'name': 'Linkshare Network'}) self.assertEqual(response_elements['deal'], {'description': '15 percent off', 'end_date': datetime.datetime(2009, 5, 31, 0, 0), 'impression_pixel': 'http://ad.linksynergy.com/fs-bin/show?id=XXXXXXXXXXX&bids=164317.10002595&type=4&subid=0', 'coupon_code': 'KJEISLD', 'coupon_restriction': 'New Customers Only', 'click_tracking_url': 'http://click.linksynergy.com/fs-bin/click?id=XXXXXXXXXXX&offerid=164317.10002595&type=4&subid=0', 'start_date': datetime.datetime(2009, 4, 1, 0, 0)})