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)
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)
def create_model(self, store): serial = ProductionProducedItem.get_last_serial_number( self._product, store) return Settable(serial_number=serial + 1)