Exemplo n.º 1
0
 def test_increment_by_timedelta(self):
     dummy = mommy.make_recipe("test.generic.serial_datetime")
     self.assertEqual(dummy.default_date_field, (TEST_TIME.date() + timedelta(days=1)))
     self.assertEqual(dummy.default_date_time_field, tz_aware(TEST_TIME + timedelta(hours=3)))
     self.assertEqual(dummy.default_time_field, (TEST_TIME + timedelta(seconds=15)).time())
     dummy = mommy.make_recipe("test.generic.serial_datetime")
     self.assertEqual(dummy.default_date_field, (TEST_TIME.date() + timedelta(days=2)))
     self.assertEqual(dummy.default_date_time_field, tz_aware(TEST_TIME + timedelta(hours=6)))
     self.assertEqual(dummy.default_time_field, (TEST_TIME + timedelta(seconds=30)).time())
Exemplo n.º 2
0
 def test_increment_by_timedelta(self):
     dummy = mommy.make_recipe('test.generic.serial_datetime')
     self.assertEqual(dummy.default_date_field, (TEST_TIME.date() + timedelta(days=1)))
     self.assertEqual(dummy.default_date_time_field, tz_aware(TEST_TIME + timedelta(hours=3)))
     self.assertEqual(dummy.default_time_field, (TEST_TIME + timedelta(seconds=15)).time())
     dummy = mommy.make_recipe('test.generic.serial_datetime')
     self.assertEqual(dummy.default_date_field, (TEST_TIME.date() + timedelta(days=2)))
     self.assertEqual(dummy.default_date_time_field, tz_aware(TEST_TIME + timedelta(hours=6)))
     self.assertEqual(dummy.default_time_field, (TEST_TIME + timedelta(seconds=30)).time())