Commit f56ba712 authored by Julien Muchembled's avatar Julien Muchembled

getEffectiveModel now raises if the catalog return nothin

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34357 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5ab0af87
No related merge requests found
......@@ -576,15 +576,15 @@ class TestEffectiveTradeCondition(TradeConditionTestCase):
start_date=DateTime('2009/06/01'),
stop_date=DateTime('2009/06/01')))
# outside date range, nothing
self.assertEquals(None,
self.trade_condition.getEffectiveModel(
# outside date range: should it raise or return nothing ?
self.assertRaises(Exception,
self.trade_condition.getEffectiveModel,
start_date=DateTime('2008/06/01'),
stop_date=DateTime('2008/06/01')))
self.assertEquals(None,
self.trade_condition.getEffectiveModel(
stop_date=DateTime('2008/06/01'))
self.assertRaises(Exception,
self.trade_condition.getEffectiveModel,
start_date=DateTime('2010/06/01'),
stop_date=DateTime('2010/06/01')))
stop_date=DateTime('2010/06/01'))
def test_getEffectiveModel_return_self(self):
# getEffectiveModel returns the trade condition if it's effective
......
......@@ -589,15 +589,15 @@ class TestEffectiveTradeCondition(TradeConditionTestCase):
start_date=DateTime('2009/06/01'),
stop_date=DateTime('2009/06/01')))
# outside date range, nothing
self.assertEquals(None,
self.trade_condition.getEffectiveModel(
# outside date range: should it raise or return nothing ?
self.assertRaises(Exception,
self.trade_condition.getEffectiveModel,
start_date=DateTime('2008/06/01'),
stop_date=DateTime('2008/06/01')))
self.assertEquals(None,
self.trade_condition.getEffectiveModel(
stop_date=DateTime('2008/06/01'))
self.assertRaises(Exception,
self.trade_condition.getEffectiveModel,
start_date=DateTime('2010/06/01'),
stop_date=DateTime('2010/06/01')))
stop_date=DateTime('2010/06/01'))
def test_getEffectiveModel_return_self(self):
# getEffectiveModel returns the trade condition if it's effective
......
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