コード例 #1
0
ファイル: test_production.py プロジェクト: amaurihamasu/stoq
    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)
コード例 #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.assertEqual(last, 0)

        pitem.serial_number = 10
        last = ProductionProducedItem.get_last_serial_number(
            pitem.product, self.store)
        self.assertEqual(last, 10)
コード例 #3
0
 def create_model(self, store):
     serial = ProductionProducedItem.get_last_serial_number(
         self._product, store)
     return Settable(serial_number=serial + 1)
コード例 #4
0
 def create_model(self, store):
     serial = ProductionProducedItem.get_last_serial_number(
         self._product, store)
     return Settable(serial_number=serial + 1)