

def test_calculate_start_date_without_today_option(self):
    now = datetime.utcnow()
    reminder = CaseReminderHandler(domain='reminder-calculation-test', use_today_if_start_date_is_blank=False)
    case = CommCareCase(domain='reminder-calculation-test')
    self.assertEqual(reminder.get_case_criteria_reminder_start_date_info(case, now), (now, True, True))
    reminder.start_date = 'start_date_case_property'
    self.assertEqual(reminder.get_case_criteria_reminder_start_date_info(case, now), (None, False, False))
    set_case_property_directly(case, 'start_date_case_property', '')
    self.assertEqual(reminder.get_case_criteria_reminder_start_date_info(case, now), (None, False, False))
    set_case_property_directly(case, 'start_date_case_property', '   ')
    self.assertEqual(reminder.get_case_criteria_reminder_start_date_info(case, now), (None, False, False))
    set_case_property_directly(case, 'start_date_case_property', 'abcdefg')
    self.assertEqual(reminder.get_case_criteria_reminder_start_date_info(case, now), (None, False, False))
    set_case_property_directly(case, 'start_date_case_property', '2016-01-32')
    self.assertEqual(reminder.get_case_criteria_reminder_start_date_info(case, now), (None, False, False))
    set_case_property_directly(case, 'start_date_case_property', '2016-01-10')
    self.assertEqual(reminder.get_case_criteria_reminder_start_date_info(case, now), (datetime(2016, 1, 10), True, False))
    set_case_property_directly(case, 'start_date_case_property', date(2016, 1, 11))
    self.assertEqual(reminder.get_case_criteria_reminder_start_date_info(case, now), (datetime(2016, 1, 11), True, False))
    set_case_property_directly(case, 'start_date_case_property', datetime(2016, 1, 12))
    self.assertEqual(reminder.get_case_criteria_reminder_start_date_info(case, now), (datetime(2016, 1, 12), True, False))

dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/reminders/tests/__init__.py ReminderDefinitionCalculationsTestCase.test_calculate_start_date_without_today_option/original