diff options
Diffstat (limited to 'iso8601')
-rw-r--r-- | iso8601/iso8601.py | 4 | ||||
-rw-r--r-- | iso8601/test_iso8601.py | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/iso8601/iso8601.py b/iso8601/iso8601.py index c8284d4..59273e1 100644 --- a/iso8601/iso8601.py +++ b/iso8601/iso8601.py @@ -115,9 +115,7 @@ else: and (other.__name == self.__name) ) - if isinstance(other, tzinfo): - return other == self - return False + return NotImplemented def __getinitargs__(self): return (self.__offset_hours, self.__offset_minutes, self.__name) diff --git a/iso8601/test_iso8601.py b/iso8601/test_iso8601.py index bc5e763..0d01ffb 100644 --- a/iso8601/test_iso8601.py +++ b/iso8601/test_iso8601.py @@ -12,6 +12,10 @@ from iso8601 import iso8601 def test_iso8601_regex(): assert iso8601.ISO8601_REGEX.match("2006-10-11T00:14:33Z") +def test_fixedoffset_eq(): + # See https://bitbucket.org/micktwomey/pyiso8601/issues/19 + datetime.tzinfo() == iso8601.FixedOffset(2, 0, '+2:00') + def test_parse_no_timezone_different_default(): tz = iso8601.FixedOffset(2, 0, "test offset") d = iso8601.parse_date("2007-01-01T08:00:00", default_timezone=tz) |