Commit 4c4cd37e authored by Jérome Perrin's avatar Jérome Perrin

testInventoryAPI: verify warning with BBB quantity unit

parent 64a42d07
...@@ -36,6 +36,7 @@ import os ...@@ -36,6 +36,7 @@ import os
import random import random
import unittest import unittest
from unittest import expectedFailure from unittest import expectedFailure
import warnings
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from DateTime import DateTime from DateTime import DateTime
...@@ -4189,7 +4190,14 @@ class TestUnitConversionBackwardCompatibility(BaseTestUnitConversion): ...@@ -4189,7 +4190,14 @@ class TestUnitConversionBackwardCompatibility(BaseTestUnitConversion):
delivery.confirm() delivery.confirm()
delivery.start() delivery.start()
delivery.stop() delivery.stop()
with warnings.catch_warnings(record=True) as catched_warnings:
self.tic() self.tic()
self.assertIn(
'quantity field of quantity_unit categories is deprecated. '
'Please use Quantity Unit Conversion Definitions instead and '
'reset the value of this field.',
[str(w.message) for w in catched_warnings],
)
# inventories of that resource are indexed in grams # inventories of that resource are indexed in grams
self.assertEqual(3010, self.assertEqual(3010,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment