Exemplo n.º 1
0
    def test_verbose_availability_with_stock_sold_out(self):
        OrderRoundFactory()
        product = ProductFactory(order_round=None)
        stock = ProductStockFactory(product=product, type=ProductStock.TYPE_ADDED)
        OrderProductFactory(product=product, amount=stock.amount,
                            order__paid=True)

        self.assertEqual(product.verbose_availability(), "uitverkocht")
Exemplo n.º 2
0
 def test_verbose_availability_with_stock_2(self):
     product = ProductFactory(order_round=None)
     stock1 = ProductStockFactory(product=product,
                                  type=ProductStock.TYPE_ADDED)
     stock2 = ProductStockFactory(product=product,
                                  type=ProductStock.TYPE_ADDED)
     self.assertEqual(product.verbose_availability(),
                      "%s in voorraad" % (stock1.amount + stock2.amount))
Exemplo n.º 3
0
    def test_verbose_availability_with_stock_3(self):
        OrderRoundFactory()
        product = ProductFactory(order_round=None)
        stock1 = ProductStockFactory(product=product, type=ProductStock.TYPE_ADDED)
        stock2 = ProductStockFactory(product=product, type=ProductStock.TYPE_ADDED)
        odp1 = OrderProductFactory(product=product, amount=1, order__paid=True)

        self.assertEqual(product.verbose_availability(), "%s in voorraad" % ((stock1.amount + stock2.amount) - odp1.amount))
Exemplo n.º 4
0
 def test_verbose_availability_with_stock_2(self):
     product = ProductFactory(order_round=None)
     stock1 = ProductStockFactory(product=product,
                                  type=ProductStock.TYPE_ADDED)
     stock2 = ProductStockFactory(product=product,
                                  type=ProductStock.TYPE_ADDED)
     self.assertEqual(product.verbose_availability(),
                      "%s in voorraad" % (stock1.amount + stock2.amount))
Exemplo n.º 5
0
    def test_verbose_availability_with_stock_4(self):
        OrderRoundFactory()
        product = ProductFactory(order_round=None)
        stock1 = ProductStockFactory(product=product, type=ProductStock.TYPE_ADDED, amount=10)
        stock2 = ProductStockFactory(product=product, type=ProductStock.TYPE_ADDED, amount=5)
        stock3 = ProductStockFactory(product=product, type=ProductStock.TYPE_LOST, amount=3)
        odp1 = OrderProductFactory(product=product, amount=1, order__paid=True)

        self.assertEqual(product.verbose_availability(), "11 in voorraad")
Exemplo n.º 6
0
    def test_verbose_availability_with_stock_sold_out(self):
        OrderRoundFactory()
        product = ProductFactory(order_round=None)
        stock = ProductStockFactory(product=product,
                                    type=ProductStock.TYPE_ADDED)
        OrderProductFactory(product=product,
                            amount=stock.amount,
                            order__paid=True)

        self.assertEqual(product.verbose_availability(), "uitverkocht")
Exemplo n.º 7
0
    def test_verbose_availability_with_stock_3(self):
        OrderRoundFactory()
        product = ProductFactory(order_round=None)
        stock1 = ProductStockFactory(product=product,
                                     type=ProductStock.TYPE_ADDED)
        stock2 = ProductStockFactory(product=product,
                                     type=ProductStock.TYPE_ADDED)
        odp1 = OrderProductFactory(product=product, amount=1, order__paid=True)

        self.assertEqual(
            product.verbose_availability(),
            "%s in voorraad" % ((stock1.amount + stock2.amount) - odp1.amount))
Exemplo n.º 8
0
    def test_verbose_availability_with_stock_4(self):
        OrderRoundFactory()
        product = ProductFactory(order_round=None)
        ProductStockFactory(product=product,
                            type=ProductStock.TYPE_ADDED,
                            amount=10)
        ProductStockFactory(product=product,
                            type=ProductStock.TYPE_ADDED,
                            amount=5)
        ProductStockFactory(product=product,
                            type=ProductStock.TYPE_LOST,
                            amount=3)
        OrderProductFactory(product=product, amount=1, order__paid=True)

        self.assertEqual(product.verbose_availability(), "11 in voorraad")
Exemplo n.º 9
0
 def test_verbose_availability_2(self):
     product = ProductFactory(maximum_total_order=None)
     self.assertEqual(product.verbose_availability(), "Onbeperkt")
Exemplo n.º 10
0
 def test_verbose_availability_1(self):
     product = ProductFactory(maximum_total_order=99)
     o1 = OrderProductFactory(product=product, order__paid=True).amount
     o2 = OrderProductFactory(product=product, order__paid=True).amount
     self.assertEqual(product.verbose_availability(),
                      "%s van 99" % (99 - (o1 + o2)))
Exemplo n.º 11
0
 def test_verbose_availability_2(self):
     product = ProductFactory(maximum_total_order=None)
     self.assertEqual(product.verbose_availability(), "Onbeperkt")
Exemplo n.º 12
0
 def test_verbose_availability_1(self):
     product = ProductFactory(maximum_total_order=99)
     o1 = OrderProductFactory(product=product, order__paid=True).amount
     o2 = OrderProductFactory(product=product, order__paid=True).amount
     self.assertEqual(product.verbose_availability(), "%s van 99" % (99 - (o1 + o2)))