code: def generate_testdata(field_type, driver):
      """Generate test cases for test_datefield
  
      Each test case has the format [(in_value1, true_value as datetime.*object),
                                     (in_value2, true_value as datetime.*object), ...]
      """
  
      # Test data for 'date' data type
      if field_type == "date":
          return [
              ("2018-03-25", datetime.date(2018, 3, 25)),
              (datetime.date(2018, 3, 25), datetime.date(2018, 3, 25)),
          ]
  
      # Test data for 'datetime' data type
      if field_type == "datetime":
          return [
              (
                  "2018-03-25T22:49:05",
                  datetime.datetime(2018, 3, 25, 22, 49, 5),
              ),
              (
                  datetime.datetime(2018, 3, 25, 22, 49, 5),
                  datetime.datetime(2018, 3, 25, 22, 49, 5),
              ),
              (
                  "2018-03-25T22:49:05.23",
                  datetime.datetime(2018, 3, 25, 22, 49, 5, 230000),
              ),
              (
                  datetime.datetime(2018, 3, 25, 22, 49, 5, 230000),
                  datetime.datetime(2018, 3, 25, 22, 49, 5, 230000),
              ),
              (
                  "2018-03-25T22:49:05.123456",
                  datetime.datetime(2018, 3, 25, 22, 49, 5, 123000),
              ),
              (
                  datetime.datetime(2018, 3, 25, 22, 49, 5, 123456),
                  datetime.datetime(2018, 3, 25, 22, 49, 5, 123000),
              ),
              (
                  "2018-03-25T22:49:05+01:30",
                  datetime.datetime(
                      2018, 3, 25, 22, 49, 5, tzinfo=TZ(90)
                  ),
              ),
              (
                  "2018-03-25T22:49:05-01:30",
                  datetime.datetime(
                      2018, 3, 25, 22, 49, 5, tzinfo=TZ(-90)
                  ),
              ),
              (
                  datetime.datetime(
                      2018, 3, 25, 22, 49, 5, tzinfo=TZ(90)
                  ),
                  datetime.datetime(
                      2018, 3, 25, 22, 49, 5, tzinfo=TZ(90)
                  ),
              ),
              (
                  datetime.datetime(
                      2018, 3, 25, 22, 49, 5, tzinfo=TZ(-90)
                  ),
                  datetime.datetime(
                      2018, 3, 25, 22, 49, 5, tzinfo=TZ(-90)
                  ),
              ),
              (
                  datetime.datetime(
                      2020, 1, 21, 12, 0, 0, tzinfo=pytz.utc
                  ).astimezone(timezone("Europe/Zurich")),
                  datetime.datetime(
                      2020, 1, 21, 12, 0, 0, tzinfo=pytz.utc
                  ).astimezone(timezone("Europe/Zurich")),
              ),
              (
                  datetime.datetime(
                      2020, 1, 21, 12, 0, 0, tzinfo=pytz.utc
                  ).astimezone(timezone("America/Denver")),
                  datetime.datetime(
                      2020, 1, 21, 12, 0, 0, tzinfo=pytz.utc
                  ).astimezone(timezone("America/Denver")),
              ),
              (
                  datetime.datetime(
                      2018, 3, 25, 22, 49, 5, tzinfo=TZ(60 * 24 - 15)
                  ),
                  datetime.datetime(
                      2018, 3, 25, 22, 49, 5, tzinfo=TZ(60 * 24 - 15)
                  ),
              ),
              (
                  datetime.datetime(
                      2018, 3, 25, 22, 49, 5, tzinfo=TZ(-60 * 24 + 15)
                  ),
                  datetime.datetime(
                      2018, 3, 25, 22, 49, 5, tzinfo=TZ(-60 * 24 + 15)
                  ),
              ),
              (
                  "2018-03-25T22:49:05-23:45",
                  datetime.datetime(
                      2018, 3, 25, 22, 49, 5, tzinfo=TZ(-60 * 24 + 15)
                  ),
              ),
              (
                  "2018-03-25T22:49:05+23:45",
                  datetime.datetime(
                      2018, 3, 25, 22, 49, 5, tzinfo=TZ(60 * 24 - 15)
                  ),
              ),
          ]
  
      # Test data for 'time' data type
      elif field_type == "time":
          return [
              ("22:49:05", datetime.time(22, 49, 5)),
              (datetime.time(22, 49, 5), datetime.time(22, 49, 5)),
              ("22:49:05.23", datetime.time(22, 49, 5, 230000)),
              (
                  datetime.time(22, 49, 5, 230000),
                  datetime.time(22, 49, 5, 230000),
              ),
              ("22:49:05.123456", datetime.time(22, 49, 5, 123000)),
              (
                  datetime.time(22, 49, 5, 123456),
                  datetime.time(22, 49, 5, 123000),
              ),
              (
                  "22:49:05+01:30",
                  datetime.time(22, 49, 5, tzinfo=TZ(90)),
              ),
              (
                  "22:49:05-01:30",
                  datetime.time(22, 49, 5, tzinfo=TZ(-90)),
              ),
              (
                  datetime.time(22, 49, 5, tzinfo=TZ(90)),
                  datetime.time(22, 49, 5, tzinfo=TZ(90)),
              ),
              (
                  datetime.time(22, 49, 5, tzinfo=TZ(-90)),
                  datetime.time(22, 49, 5, tzinfo=TZ(-90)),
              ),
              (
                  datetime.time(22, 49, 5, tzinfo=TZ(60 * 24 - 15)),
                  datetime.time(22, 49, 5, tzinfo=TZ(60 * 24 - 15)),
              ),
              (
                  datetime.time(22, 49, 5, tzinfo=TZ(-60 * 24 + 15)),
                  datetime.time(22, 49, 5, tzinfo=TZ(-60 * 24 + 15)),
              ),
              (
                  "22:49:05-23:45",
                  datetime.time(22, 49, 5, tzinfo=TZ(-60 * 24 + 15)),
              ),
              (
                  "22:49:05+23:45",
                  datetime.time(22, 49, 5, tzinfo=TZ(60 * 24 - 15)),
              ),
          ]
  
imports: import fiona
  from fiona._env import get_gdal_version_num, calc_gdal_version_num
  import pytest
  from fiona.errors import DriverSupportError
  from fiona.rfc3339 import parse_time, parse_datetime
  from .conftest import get_temp_filename
  from fiona.env import GDALVersion
  from fiona.model import Feature
  import datetime
  from fiona.drvsupport import supported_drivers, driver_mode_mingdal, _driver_converts_field_type_silently_to_str, _driver_supports_field, _driver_converts_to_str, _driver_supports_timezones, _driver_supports_milliseconds, _driver_supports_mode
  import pytz
  from pytz import timezone
label_desc: Use image node_id 5 for calling a global function with example usage: generate_testdata(field_type, driver) and returns: list, list, list