def test_totals_2(self): """Add a product with explicit quantity to cart """ rf = RequestFactory() request = rf.post("/", {"product_id": self.p1.id, "quantity": 2}) request.session = self.session request.user = self.user locale.setlocale(locale.LC_ALL, 'en_US.UTF-8') # Added product_1 two times to cart add_to_cart(request) response = added_to_cart_items(request) self.failIf(response.find(u"Total: $20.00") == -1) # Added product_1 two times to cart again add_to_cart(request) response = added_to_cart_items(request) self.failIf(response.find(u"Total: $40.00") == -1)
def test_totals_2(self): """Add a product with explicit quantity to cart """ rf = RequestFactory() request = rf.post("/", {"product_id": self.p1.id, "quantity": 2}) request.session = self.session request.user = self.user locale.setlocale(locale.LC_ALL, "en_US.UTF-8") # Added product_1 two times to cart add_to_cart(request) response = added_to_cart_items(request) self.failIf(response.find(u"Total: $20.00") == -1) # Added product_1 two times to cart again add_to_cart(request) response = added_to_cart_items(request) self.failIf(response.find(u"Total: $40.00") == -1)
def test_totals_1(self): """Add a product without quantity to cart (implicit 1) """ rf = RequestFactory() request = rf.post("/", {"product_id": self.p1.id}) request.session = self.session request.user = self.user locale.setlocale(locale.LC_ALL, 'en_US.UTF-8') # Added product_1 to cart add_to_cart(request) response = added_to_cart_items(request) # need to test for two versions of currency output (Mac and Ubuntu differ) self.failIf(response.find(u"Total: $10.00") == -1) # Added product_1 to cart again add_to_cart(request) response = added_to_cart_items(request) self.failIf(response.find(u"Total: $20.00") == -1)
def test_totals_2(self): """Add a product with explicit quantity to cart """ rf = RequestFactory() request = rf.post("/", {"product_id": self.p1.id, "quantity": 2}) request.session = self.session request.user = self.user # Check we are using german locale shop = lfs_get_object_or_404(Shop, pk=1) self.assertEqual(shop.default_locale, 'en_US.UTF-8') # Added product_1 two times to cart add_to_cart(request) response = added_to_cart_items(request) self.failIf(response.find(u"Total: $20.00") == -1) # Added product_1 two times to cart again add_to_cart(request) response = added_to_cart_items(request) self.failIf(response.find(u"Total: $40.00") == -1)
def test_totals_1(self): """Add a product without quantity to cart (implicit 1) """ rf = RequestFactory() request = rf.post("/", {"product_id": self.p1.id}) request.session = self.session request.user = self.user locale.setlocale(locale.LC_ALL, "en_US.UTF-8") # Added product_1 to cart add_to_cart(request) response = added_to_cart_items(request) # need to test for two versions of currency output (Mac and Ubuntu differ) self.failIf(response.find(u"Total: $10.00") == -1) # Added product_1 to cart again add_to_cart(request) response = added_to_cart_items(request) self.failIf(response.find(u"Total: $20.00") == -1)
def test_totals_1(self): """Add a product without quantity to cart (implicit 1) """ rf = RequestFactory() request = rf.post("/", {"product_id": self.p1.id}) request.session = self.session request.user = self.user # Added product_1 to cart add_to_cart(request) response = added_to_cart_items(request) # Check we are using german locale shop = lfs_get_object_or_404(Shop, pk=1) self.assertEqual(shop.default_locale, 'en_US.UTF-8') # need to test for two versions of currency output (Mac and Ubuntu differ) self.failIf(response.find(u"Total: $10.00") == -1) # Added product_1 to cart again add_to_cart(request) response = added_to_cart_items(request) self.failIf(response.find(u"Total: $20.00") == -1)