diff --git a/test/model/test_datatypes.py b/test/model/test_datatypes.py index be4666c2..8021414d 100644 --- a/test/model/test_datatypes.py +++ b/test/model/test_datatypes.py @@ -7,6 +7,7 @@ import datetime import math import unittest +import copy import dateutil @@ -177,6 +178,13 @@ def test_parse_partial_dates(self) -> None: model.datatypes.from_xsd("10-10", model.datatypes.GYearMonth) self.assertEqual("Value is not a valid XSD GYearMonth string", str(cm.exception)) + def test_copy_date(self) -> None: + date = model.datatypes.Date(2020, 1, 24) + date_copy_shallow = copy.copy(date) + self.assertEqual(date, date_copy_shallow) + date_copy_deep = copy.deepcopy(date) + self.assertEqual(date, date_copy_deep) + def test_serialize_partial_dates(self) -> None: self.assertEqual("2019", model.datatypes.xsd_repr(model.datatypes.GYear(2019))) self.assertEqual("2019Z", model.datatypes.xsd_repr(model.datatypes.GYear(2019, datetime.timezone.utc)))