# Path: django_core/utils/date_parsers.py
# def hex_timestamp_to_datetime(hex_timestamp):
#     """Converts hex timestamp to a datetime object.
# 
#     >>> hex_timestamp_to_datetime('558BBCF9')
#     datetime.datetime(2015, 6, 25, 8, 34, 1)
#     >>> hex_timestamp_to_datetime('0x558BBCF9')
#     datetime.datetime(2015, 6, 25, 8, 34, 1)
#     >>> datetime.fromtimestamp(0x558BBCF9)
#     datetime.datetime(2015, 6, 25, 8, 34, 1)
#     """
#     if not hex_timestamp.startswith('0x'):
#         hex_timestamp = '0x{0}'.format(hex_timestamp)
# 
#     return datetime.fromtimestamp(int(hex_timestamp, 16))
# 
# Path: django_core/utils/date_parsers.py
# def parse_date(dt, ignoretz=True, as_tz=None):
#     """
#     :param dt: string datetime to convert into datetime object.
#     :return: date object if the string can be parsed into a date. Otherwise,
#         return None.
# 
#     :see: http://labix.org/python-dateutil
# 
#     Examples:
# 
#     >>> parse_date('2011-12-30')
#     datetime.date(2011, 12, 30)
#     >>> parse_date('12/30/2011')
#     datetime.date(2011, 12, 30)
#     """
#     dttm = parse_datetime(dt, ignoretz=ignoretz)
#     return None if dttm is None else dttm.date()


from datetime import date
from datetime import datetime
from unittest.case import TestCase
from django_core.utils.date_parsers import hex_timestamp_to_datetime
from django_core.utils.date_parsers import parse_date



class DateParsersTestCase(TestCase):
    """Test case for date parsers."""

    def test_hex_timestamp_to_datetime(self):
        """Test the conversion of a hex timestamp to a datetime object."""
        dt = datetime(2015, 6, 25, 8, 34, 1)
        self.assertEqual(hex_timestamp_to_datetime('558BBCF9'), dt)

# Path: django_core/utils/date_parsers.py
# def hex_timestamp_to_datetime(hex_timestamp):
#     """Converts hex timestamp to a datetime object.
# 
#     >>> hex_timestamp_to_datetime('558BBCF9')
#     datetime.datetime(2015, 6, 25, 8, 34, 1)
#     >>> hex_timestamp_to_datetime('0x558BBCF9')
#     datetime.datetime(2015, 6, 25, 8, 34, 1)
#     >>> datetime.fromtimestamp(0x558BBCF9)
#     datetime.datetime(2015, 6, 25, 8, 34, 1)
#     """
#     if not hex_timestamp.startswith('0x'):
#         hex_timestamp = '0x{0}'.format(hex_timestamp)
# 
#     return datetime.fromtimestamp(int(hex_timestamp, 16))
# 
# Path: django_core/utils/date_parsers.py
# def parse_date(dt, ignoretz=True, as_tz=None):
#     """
#     :param dt: string datetime to convert into datetime object.
#     :return: date object if the string can be parsed into a date. Otherwise,
#         return None.
# 
#     :see: http://labix.org/python-dateutil
# 
#     Examples:
# 
#     >>> parse_date('2011-12-30')
#     datetime.date(2011, 12, 30)
#     >>> parse_date('12/30/2011')
#     datetime.date(2011, 12, 30)
#     """
#     dttm = parse_datetime(dt, ignoretz=ignoretz)
#     return None if dttm is None else dttm.date()


# Path: tests/test_date_parsers.py
from datetime import date
from datetime import datetime
from unittest.case import TestCase
from django_core.utils.date_parsers import hex_timestamp_to_datetime
from django_core.utils.date_parsers import parse_date




class DateParsersTestCase(TestCase):
    """Test case for date parsers."""

    def test_hex_timestamp_to_datetime(self):
        """Test the conversion of a hex timestamp to a datetime object."""
        dt = datetime(2015, 6, 25, 8, 34, 1)
        self.assertEqual(hex_timestamp_to_datetime('558BBCF9'), dt)

        self.assertEqual(hex_timestamp_to_datetime('0x558BBCF9'), dt)