Ejemplo n.º 1
0
    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 = muecke_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)
Ejemplo n.º 2
0
    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 = muecke_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)
Ejemplo n.º 3
0
    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 = muecke_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)
Ejemplo n.º 4
0
    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 = muecke_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)