def test_extend_date_due_soon(self): request = self.rf.create_request_as_anonymous_user(due_date=datetime.utcnow()) date = calendar.addbusdays(utc_to_local(request.due_date, self.tz_name), 1) due_date = process_due_date(local_to_utc(date, self.tz_name)) response = request.extend(date=date) self.__test_extension( response, determination_type.EXTENSION, str, due_date, request_status.DUE_SOON, request=request)
def reopen(self, date, user=None): return self.__extend( determination_type.REOPENING, process_due_date(local_to_utc(date, self.__tz_name)), user, { "status": request_status.IN_PROGRESS, "agency_request_summary_release_date": None })
def __get_new_due_date(self, days=None, date=None): assert days is not None or date is not None if days is None: new_due_date = process_due_date(local_to_utc(date, self.__tz_name)) else: new_due_date = get_due_date( utc_to_local(self.request.due_date, self.__tz_name), days, self.__tz_name) return new_due_date
def test_reopen(self): date = calendar.addbusdays(utc_to_local(self.request.due_date, self.tz_name), 1) response = self.request.reopen(date) due_date = process_due_date(local_to_utc(date, self.tz_name)) self.__test_extension(response, determination_type.REOPENING, None, due_date) self.assertEqual(self.request.agency_request_summary, None)
def test_acknowledge_date(self): date = calendar.addbusdays(datetime.now(), 100) response = self.request.acknowledge(date=date) due_date = process_due_date(local_to_utc(date, self.tz_name)) self.__test_extension(response, determination_type.ACKNOWLEDGMENT, str, due_date)