示例#1
0
 def test_is_valid_serial_range(self):
     pitem = ProductionProducedItem(store=self.store)
     pitem.product = self.create_product()
     self.assertTrue(ProductionProducedItem.is_valid_serial_range(
         pitem.product, 1, 2, self.store))
     pitem.serial_number = 1
     self.assertFalse(ProductionProducedItem.is_valid_serial_range(
         pitem.product, 1, 2, self.store))
示例#2
0
    def test_get_last_serial_number(self):
        pitem = ProductionProducedItem(store=self.store)
        pitem.product = self.create_product()
        last = ProductionProducedItem.get_last_serial_number(pitem.product, self.store)
        self.assertEquals(last, 0)

        pitem.serial_number = 10
        last = ProductionProducedItem.get_last_serial_number(pitem.product, self.store)
        self.assertEquals(last, 10)
示例#3
0
 def test_is_valid_serial_range(self):
     pitem = ProductionProducedItem(store=self.store)
     pitem.product = self.create_product()
     self.assertTrue(
         ProductionProducedItem.is_valid_serial_range(
             pitem.product, 1, 2, self.store))
     pitem.serial_number = 1
     self.assertFalse(
         ProductionProducedItem.is_valid_serial_range(
             pitem.product, 1, 2, self.store))
示例#4
0
    def test_get_last_serial_number(self):
        pitem = ProductionProducedItem(store=self.store)
        pitem.product = self.create_product()
        last = ProductionProducedItem.get_last_serial_number(
            pitem.product, self.store)
        self.assertEqual(last, 0)

        pitem.serial_number = 10
        last = ProductionProducedItem.get_last_serial_number(
            pitem.product, self.store)
        self.assertEqual(last, 10)