def setUp(self): self.owner = User.objects.create_user("owner", "*****@*****.**", "testpw") owner_profile = Profile(user=self.owner) owner_profile.save() self.user = User.objects.create_user("test", "*****@*****.**", "testpw") self.user2 = User.objects.create_user("user2", "*****@*****.**", "user2") Profile(user=self.user).save() Profile(user=self.user2).save() self.marketplace = MarketPlace(name="greatsomething", title="Great Something", slug="great-something", template_prefix="default", base_domain="greatsomething.com") self.marketplace.save() self.shop = Shop(marketplace=self.marketplace, admin=self.owner, name="test_shop") self.shop.save() Preference(shop=self.shop).save() self.shop.update() plan = SubscriptionPlan(plan_id=1, marketplace=self.marketplace, trial_period=True, total_store_revenue=1000, concurrent_store_items=1000) plan.save() Subscription(owner=owner_profile, plan=plan).save() self.category = MarketCategory(marketplace=self.marketplace, name="Category1") self.category.save() self.subcategory = MarketSubCategory(marketplace=self.marketplace, parent=self.category, name="SubCategory1") self.subcategory.save() self.cart = Cart(shop=self.shop, bidder=self.user) self.cart.save() self.cart2 = Cart(shop=self.shop, bidder=self.user2) self.cart2.save()
def setUp(self): # create store owner user and profile self.owner = User.objects.create_user("test-owner", "*****@*****.**", "test-owner") owner_profile = Profile(user=self.owner) owner_profile.save() # create a marketplace self.marketplace = MarketPlace(name="greatcoins", title="greatcoins", slug="greatcoins", template_prefix="greatcoins", base_domain="greatcoins.com") self.marketplace.save() # create a shop self.shop = Shop(marketplace=self.marketplace, admin=self.owner, name="test_shop") self.shop.save() # create a Preference and SubscriptionPlan to shop Preference(shop=self.shop).save() self.shop.update() plan = SubscriptionPlan(plan_id=1, marketplace=self.marketplace, trial_period=True, total_store_revenue=1000, concurrent_store_items=1000) plan.save() Subscription(owner=owner_profile, plan=plan).save() # create marketplace categories and sub-categories self.category = MarketCategory(marketplace=self.marketplace, name="Category") self.category.save() self.subcategory = MarketSubCategory(marketplace=self.marketplace, parent=self.category, name="SubCategory") self.subcategory.save() # create a user, profile and shipping data self.user = User.objects.create_user("test-user", "*****@*****.**", "test-user") Profile(user=self.user).save() shippingdata = ShippingData(first_name='User', last_name='Buyer', street_address="Calle 54", city="La Plata", state="Buenos Aires", zip="1900", country="AR") shippingdata.save() # create a shopping cart self.cart = Cart(shop=self.shop, bidder=self.user) self.cart.shippingdata = shippingdata self.cart.save()
def setUp(self): self.owner = User.objects.create_user("owner", "*****@*****.**", "testpw") owner_profile = Profile(user=self.owner) owner_profile.save() self.user = User.objects.create_user("test", "*****@*****.**", "testpw") self.user2 = User.objects.create_user("user2", "*****@*****.**", "user2") Profile(user=self.user).save() Profile(user=self.user2).save() self.marketplace = MarketPlace( name="greatsomething", title="Great Something", slug="great-something", template_prefix="default", base_domain="greatsomething.com", ) self.marketplace.save() self.shop = Shop(marketplace=self.marketplace, admin=self.owner, name="test_shop") self.shop.save() Preference(shop=self.shop).save() self.shop.update() plan = SubscriptionPlan( plan_id=1, marketplace=self.marketplace, trial_period=True, total_store_revenue=1000, concurrent_store_items=1000, ) plan.save() Subscription(owner=owner_profile, plan=plan).save() self.category = MarketCategory(marketplace=self.marketplace, name="Category1") self.category.save() self.subcategory = MarketSubCategory(marketplace=self.marketplace, parent=self.category, name="SubCategory1") self.subcategory.save() self.cart = Cart(shop=self.shop, bidder=self.user) self.cart.save() self.cart2 = Cart(shop=self.shop, bidder=self.user2) self.cart2.save()