def test_can_create_feed_for_base_attributes(self): product = create_product() profile = factories.AmazonProfileFactory( product=product, release_date=UTC_NOW) mapper = ProductMapper(product=product) xml = etree.tostring(mapper.get_product_xml()) self.assertIn( '<SKU>{0}</SKU>'.format(profile.sku), xml) self.assertIn( '<ReleaseDate>{0}</ReleaseDate>'.format(UTC_NOW.isoformat()), xml) self.assertIn('<Title>{0}</Title>'.format(product.title), xml)
def setUp(self): super(TestBaseProductMapper, self).setUp() self.mapper = ProductMapper(product=mock.MagicMock())