class TestExtractExamees(TestCase):
@classmethod
def setUpTestData(cls):
"""テスト用のデータを作成
長いので省略
"""
...
def test_iter_birthday_month_employees(self):
actual = medical_checkup.core.extract_examinee.iter_birthday_month_employees(today=datetime.date(2019, 5, 1))
actual_list = list(actual)
with self.subTest('5月が誕生日である社員がリストに入ってる'):
self.assertTrue(
employee.types.Employee(
id=self.emp_1.id,
birthday=datetime.date(1990, 5, 10),
gender=employee.types.Gender(1),
is_manager=False
) and
employee.types.Employee(
id=self.emp_2.id,
birthday=datetime.date(1980, 5, 11),
gender=employee.types.Gender(0),
is_manager=True
)
in actual_list
)