예제 #1
0
 def test_must_supply_valid_timepoint(self):
     today = datetime.date.today()
     h = Habit(description="Brush my teeth",
               start=today,
               user=self.user,
               resolution='day')
     with self.assertRaises(ValueError):
         h.record(today, 5)
예제 #2
0
 def test_cannot_record_negative_value(self):
     today = datetime.date.today()
     h = Habit(description="Brush my teeth",
               start=today,
               user=self.user,
               resolution='day')
     t = TimePeriod('day', 0, today)
     with self.assertRaises(ValueError):
         h.record(t, -10)