def test_returns_list_of_related_market_places(self): marketplaces = [ factories.AmazonMarketplaceFactory(merchant=self.merchant), factories.AmazonMarketplaceFactory(merchant=self.merchant) ] self.merchant.marketplaces.add(marketplaces[0]) self.merchant.marketplaces.add(marketplaces[1]) self.assertEquals(self.merchant.marketplace_ids, [m.marketplace_id for m in marketplaces])
def setUp(self): super(TestAmazonProfileDashboard, self).setUp() self.product = factories.ProductFactory(amazon_profile=None) self.marketplace = factories.AmazonMarketplaceFactory() try: self.product.amazon_profile except AmazonProfile.DoesNotExist: pass else: self.fail("product has Amazon profile but shouldn't")
def setUp(self): super(TestUpdateInventory, self).setUp() self.original_bases = StockRecord.__bases__ if not mws_mixins.AmazonStockTrackingMixin in StockRecord.__bases__: StockRecord.__bases__ += (mws_mixins.AmazonStockTrackingMixin, ) marketplace = factories.AmazonMarketplaceFactory() product = factories.ProductFactory( stockrecord__partner=marketplace.merchant.partner, amazon_profile__sku='SKU_12345') self.profile = product.amazon_profile self.profile.marketplaces.add(marketplace) self.assertEquals(self.profile.product.stockrecords.count(), 1) self.stockrecord = self.profile.product.stockrecords.all()[0] self.assertFalse(self.stockrecord.num_in_stock) self.assertFalse(self.stockrecord.num_allocated)
def setUp(self): self.product = factories.ProductFactory( upc='9781741173420', title='Kayaking Around Australia', amazon_profile=None) self.merchant = factories.MerchantAccountFactory( name="Integration Test Account", seller_id=os.getenv('SELLER_ID'), aws_api_key=os.getenv('AWS_ACCESS_KEY_ID'), aws_api_secret=os.getenv('AWS_SECRET_ACCESS_KEY')) self.marketplace = factories.AmazonMarketplaceFactory( merchant=self.merchant, marketplace_id='ATVPDKIKX0DER') amazon_profile = factories.AmazonProfileFactory( product=self.product, fulfillment_by=AmazonProfile.FULFILLMENT_BY_AMAZON) amazon_profile.marketplaces.add(self.marketplace)
def setUp(self): super(TestSubmittingProductFeed, self).setUp() self.product = create_product() self.marketplace = factories.AmazonMarketplaceFactory()