'Test Date class is ordered consistently
@since 3.9
@jira_ticket PYTHON-714
@expected_result the dates are ordered correctly
@test_category data_types'

def test_date_order(self):

    dates_from_string = [Date('2017-01-01'), Date('2017-01-05'), Date('2017-01-09'), Date('2017-01-13')]
    dates_from_string_equal = [Date('2017-01-01'), Date('2017-01-01')]
    self._check_sequence_consistency(dates_from_string)
    self._check_sequence_consistency(dates_from_string_equal, equal=True)
    date_format = '%Y-%m-%d'
    dates_from_value = [Date((datetime.datetime.strptime(dtstr, date_format) - datetime.datetime(1970, 1, 1)).days) for dtstr in ('2017-01-02', '2017-01-06', '2017-01-10', '2017-01-14')]
    dates_from_value_equal = [Date(1), Date(1)]
    self._check_sequence_consistency(dates_from_value)
    self._check_sequence_consistency(dates_from_value_equal, equal=True)
    dates_from_datetime = [Date(datetime.datetime.strptime(dtstr, date_format)) for dtstr in ('2017-01-03', '2017-01-07', '2017-01-11', '2017-01-15')]
    dates_from_datetime_equal = [Date(datetime.datetime.strptime('2017-01-01', date_format)), Date(datetime.datetime.strptime('2017-01-01', date_format))]
    self._check_sequence_consistency(dates_from_datetime)
    self._check_sequence_consistency(dates_from_datetime_equal, equal=True)
    dates_from_date = [Date(datetime.datetime.strptime(dtstr, date_format).date()) for dtstr in ('2017-01-04', '2017-01-08', '2017-01-12', '2017-01-16')]
    dates_from_date_equal = [datetime.datetime.strptime(dtstr, date_format) for dtstr in ('2017-01-09', '2017-01-9')]
    self._check_sequence_consistency(dates_from_date)
    self._check_sequence_consistency(dates_from_date_equal, equal=True)
    self._check_sequence_consistency(self._shuffle_lists(dates_from_string, dates_from_value, dates_from_datetime, dates_from_date))
