Browse Source

[MIG] sequence_reset_period: Fix Travis warnings

pull/64/head
Jaume Planas 6 years ago
parent
commit
f89bee059e
  1. 40
      sequence_reset_period/tests/test_period.py

40
sequence_reset_period/tests/test_period.py

@ -25,50 +25,50 @@ class TestSequence(common.TransactionCase):
self.assertFalse(sequence.date_range_ids) self.assertFalse(sequence.date_range_ids)
self.assertEqual('00001', sequence.with_context( self.assertEqual('00001', sequence.with_context(
ir_sequence_date=self.date).next_by_id()) ir_sequence_date=self.date).next_by_id())
range = sequence.date_range_ids
self.assertTrue(range)
self.assertEqual(date(2018, 1, 1), range.date_from)
self.assertEqual(date(2018, 12, 31), range.date_to)
xrange = sequence.date_range_ids
self.assertTrue(xrange)
self.assertEqual(date(2018, 1, 1), xrange.date_from)
self.assertEqual(date(2018, 12, 31), xrange.date_to)
def test_daily(self): def test_daily(self):
sequence = self.get_sequence('daily') sequence = self.get_sequence('daily')
self.assertFalse(sequence.date_range_ids) self.assertFalse(sequence.date_range_ids)
self.assertEqual('00001', sequence.with_context( self.assertEqual('00001', sequence.with_context(
ir_sequence_date=self.date).next_by_id()) ir_sequence_date=self.date).next_by_id())
range = sequence.date_range_ids
self.assertTrue(range)
self.assertEqual(self.date, range.date_from)
self.assertEqual(self.date, range.date_to)
xrange = sequence.date_range_ids
self.assertTrue(xrange)
self.assertEqual(self.date, xrange.date_from)
self.assertEqual(self.date, xrange.date_to)
def test_weekly(self): def test_weekly(self):
sequence = self.get_sequence('weekly') sequence = self.get_sequence('weekly')
self.assertFalse(sequence.date_range_ids) self.assertFalse(sequence.date_range_ids)
self.assertEqual('00001', sequence.with_context( self.assertEqual('00001', sequence.with_context(
ir_sequence_date=self.date).next_by_id()) ir_sequence_date=self.date).next_by_id())
range = sequence.date_range_ids
self.assertTrue(range)
self.assertEqual(date(2018, 3, 12), range.date_from)
self.assertEqual(date(2018, 3, 18), range.date_to)
xrange = sequence.date_range_ids
self.assertTrue(xrange)
self.assertEqual(date(2018, 3, 12), xrange.date_from)
self.assertEqual(date(2018, 3, 18), xrange.date_to)
def test_monthly(self): def test_monthly(self):
sequence = self.get_sequence('monthly') sequence = self.get_sequence('monthly')
self.assertFalse(sequence.date_range_ids) self.assertFalse(sequence.date_range_ids)
self.assertEqual('00001', sequence.with_context( self.assertEqual('00001', sequence.with_context(
ir_sequence_date=self.date).next_by_id()) ir_sequence_date=self.date).next_by_id())
range = sequence.date_range_ids
self.assertTrue(range)
self.assertEqual(date(2018, 3, 1), range.date_from)
self.assertEqual(date(2018, 3, 31), range.date_to)
xrange = sequence.date_range_ids
self.assertTrue(xrange)
self.assertEqual(date(2018, 3, 1), xrange.date_from)
self.assertEqual(date(2018, 3, 31), xrange.date_to)
def test_yearly(self): def test_yearly(self):
sequence = self.get_sequence('yearly') sequence = self.get_sequence('yearly')
self.assertFalse(sequence.date_range_ids) self.assertFalse(sequence.date_range_ids)
self.assertEqual('00001', sequence.with_context( self.assertEqual('00001', sequence.with_context(
ir_sequence_date=self.date).next_by_id()) ir_sequence_date=self.date).next_by_id())
range = sequence.date_range_ids
self.assertTrue(range)
self.assertEqual(date(2018, 1, 1), range.date_from)
self.assertEqual(date(2018, 12, 31), range.date_to)
xrange = sequence.date_range_ids
self.assertTrue(xrange)
self.assertEqual(date(2018, 1, 1), xrange.date_from)
self.assertEqual(date(2018, 12, 31), xrange.date_to)
def test_monthly_existing(self): def test_monthly_existing(self):
sequence = self.get_sequence('monthly') sequence = self.get_sequence('monthly')

Loading…
Cancel
Save