Commit ec0314df authored by Jérome Perrin's avatar Jérome Perrin

test: expectedFailure on python3 can only be set on test method

parent 24b99e42
...@@ -1419,6 +1419,7 @@ class TestResource(ERP5TypeTestCase): ...@@ -1419,6 +1419,7 @@ class TestResource(ERP5TypeTestCase):
self.assertEqual(resource.getInternalSupplyLineDestinationReference(), self.assertEqual(resource.getInternalSupplyLineDestinationReference(),
'test_destination_reference_on_internal_supply_line') 'test_destination_reference_on_internal_supply_line')
@expectedFailure
def testQuantityUnitOnMovement(self): def testQuantityUnitOnMovement(self):
"""Make sure that changing default quantity unit on resource does not """Make sure that changing default quantity unit on resource does not
affect to movement. affect to movement.
...@@ -1471,7 +1472,8 @@ class TestResource(ERP5TypeTestCase): ...@@ -1471,7 +1472,8 @@ class TestResource(ERP5TypeTestCase):
# Check existing movement again and make sure that quantity # Check existing movement again and make sure that quantity
# unit is not changed. # unit is not changed.
expectedFailure(self.assertEqual)( # XXX This is the expectedFailure
self.assertEqual(
sale_order_line.getQuantityUnitValue(), sale_order_line.getQuantityUnitValue(),
self.quantity_unit_gram) self.quantity_unit_gram)
......
...@@ -164,6 +164,7 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase): ...@@ -164,6 +164,7 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase):
self.assertEqual(1, len(information_list)) self.assertEqual(1, len(information_list))
self.assertEqual(json.dumps(information_list[0]), self.data) self.assertEqual(json.dumps(information_list[0]), self.data)
@expectedFailure
def test_post_information_more_than_once_no_tic(self): def test_post_information_more_than_once_no_tic(self):
""" """
Check if posting information is working. Check if posting information is working.
...@@ -174,7 +175,8 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase): ...@@ -174,7 +175,8 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase):
self.postInformation() self.postInformation()
self.tic() self.tic()
expectedFailure(self.assertEqual)(1, # XXX this is the expected failure
self.assertEqual(1,
self.portal.portal_catalog.countResults(reference=self.key)[0][0]) self.portal.portal_catalog.countResults(reference=self.key)[0][0])
data_set = self.portal.portal_catalog.getResultValue( data_set = self.portal.portal_catalog.getResultValue(
reference=self.key) reference=self.key)
......
...@@ -73,7 +73,7 @@ class TestStaticWebSiteRedirection(ERP5TypeTestCase): ...@@ -73,7 +73,7 @@ class TestStaticWebSiteRedirection(ERP5TypeTestCase):
self.tic() self.tic()
return website return website
def runTestRedirect(self, source_path, expected_failure=None, def runTestRedirect(self, source_path,
use_moved_temporarily=None, use_moved_temporarily=None,
configuration_service_worker_url=None, **kw): configuration_service_worker_url=None, **kw):
""" """
......
...@@ -266,12 +266,10 @@ class TestSQLCatalog(ERP5TypeTestCase): ...@@ -266,12 +266,10 @@ class TestSQLCatalog(ERP5TypeTestCase):
self.assertRaises(exception, self._catalog, src__=1, query_table='foo', **kw) self.assertRaises(exception, self._catalog, src__=1, query_table='foo', **kw)
def catalog(self, reference_tree, kw, check_search_text=True, def catalog(self, reference_tree, kw, check_search_text=True,
check_select_expression=True, expected_failure=False): check_select_expression=True):
reference_param_dict = self._catalog.buildSQLQuery(query_table='foo', **kw) reference_param_dict = self._catalog.buildSQLQuery(query_table='foo', **kw)
query = self._catalog.buildEntireQuery(kw).query query = self._catalog.buildEntireQuery(kw).query
assertEqual = self.assertEqual assertEqual = self.assertEqual
if expected_failure:
assertEqual = unittest.expectedFailure(assertEqual)
assertEqual(reference_tree, query) assertEqual(reference_tree, query)
search_text = query.asSearchTextExpression(self._catalog) search_text = query.asSearchTextExpression(self._catalog)
......
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