Beispiel #1
0
 def test_day(self):
     """Test when range is one day long."""
     self.make_patient('A', datetime.date(1990, 12, 31))
     self.make_patient('B', datetime.date(1990, 1, 1))
     self.make_patient('C', datetime.date(1990, 1, 2))
     patients = Command._get_patients(datetime.date(2000, 1, 1),
                                      datetime.date(2000, 1, 1))
     patients = [x.name for x in patients]
     self.assertNotIn('A', patients)
     self.assertIn('B', patients)
     self.assertNotIn('C', patients)
Beispiel #2
0
 def test_day(self):
     """Test when range is one day long."""
     self.make_patient('A', datetime.date(1990, 12, 31))
     self.make_patient('B', datetime.date(1990, 1, 1))
     self.make_patient('C', datetime.date(1990, 1, 2))
     patients = Command._get_patients(datetime.date(2000, 1, 1),
                                      datetime.date(2000, 1, 1))
     patients = [x.name for x in patients]
     self.assertNotIn('A', patients)
     self.assertIn('B', patients)
     self.assertNotIn('C', patients)
Beispiel #3
0
 def test_week_in_month(self):
     """Test when range is one week long within a month."""
     self.make_patient('A', datetime.date(1990, 6, 5))
     self.make_patient('B', datetime.date(1990, 6, 6))
     self.make_patient('C', datetime.date(1990, 6, 12))
     self.make_patient('D', datetime.date(1990, 6, 13))
     start = datetime.date(2000, 6, 6)
     end = start + datetime.timedelta(days=6)  # inclusive
     patients = Command._get_patients(start, end)
     patients = [x.name for x in patients]
     self.assertNotIn('A', patients)
     self.assertIn('B', patients)
     self.assertIn('C', patients)
     self.assertNotIn('D', patients)
Beispiel #4
0
 def test_week_in_month(self):
     """Test when range is one week long within a month."""
     self.make_patient('A', datetime.date(1990, 6, 5))
     self.make_patient('B', datetime.date(1990, 6, 6))
     self.make_patient('C', datetime.date(1990, 6, 12))
     self.make_patient('D', datetime.date(1990, 6, 13))
     start = datetime.date(2000, 6, 6)
     end = start + datetime.timedelta(days=6)  # inclusive
     patients = Command._get_patients(start, end)
     patients = [x.name for x in patients]
     self.assertNotIn('A', patients)
     self.assertIn('B', patients)
     self.assertIn('C', patients)
     self.assertNotIn('D', patients)
Beispiel #5
0
 def test_week_split(self):
     """Test when range is one week long split across months."""
     self.make_patient('A', datetime.date(1990, 6, 27))
     self.make_patient('B', datetime.date(1990, 6, 28))
     self.make_patient('C', datetime.date(1990, 6, 30))
     self.make_patient('D', datetime.date(1990, 7, 1))
     self.make_patient('E', datetime.date(1990, 7, 4))
     self.make_patient('F', datetime.date(1990, 7, 5))
     start = datetime.date(2000, 6, 28)
     end = start + datetime.timedelta(days=6)  # inclusive
     patients = Command._get_patients(start, end)
     patients = [x.name for x in patients]
     self.assertNotIn('A', patients)
     self.assertIn('B', patients)
     self.assertIn('C', patients)
     self.assertIn('D', patients)
     self.assertIn('E', patients)
     self.assertNotIn('F', patients)
Beispiel #6
0
 def test_week_split(self):
     """Test when range is one week long split across months."""
     self.make_patient('A', datetime.date(1990, 6, 27))
     self.make_patient('B', datetime.date(1990, 6, 28))
     self.make_patient('C', datetime.date(1990, 6, 30))
     self.make_patient('D', datetime.date(1990, 7, 1))
     self.make_patient('E', datetime.date(1990, 7, 4))
     self.make_patient('F', datetime.date(1990, 7, 5))
     start = datetime.date(2000, 6, 28)
     end = start + datetime.timedelta(days=6)  # inclusive
     patients = Command._get_patients(start, end)
     patients = [x.name for x in patients]
     self.assertNotIn('A', patients)
     self.assertIn('B', patients)
     self.assertIn('C', patients)
     self.assertIn('D', patients)
     self.assertIn('E', patients)
     self.assertNotIn('F', patients)