From f7c148ec05f006b3385e26017940604ffe9cb7ce Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Sun, 22 Mar 2015 15:50:12 +0100 Subject: [PATCH] tests: Skip filtering by string datetime test for TW < 2.4.0 --- tasklib/tests.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tasklib/tests.py b/tasklib/tests.py index f1247af..b740c0d 100644 --- a/tasklib/tests.py +++ b/tasklib/tests.py @@ -851,6 +851,14 @@ class DatetimeStringTest(TasklibTest): self.assertEqual(due_date, t['due']) def test_filtering_with_string_datetime(self): + if self.tw.version < six.text_type('2.4.0'): + # Python2.6 does not support SkipTest. As a workaround + # mark the test as passed by exiting. + if getattr(unittest, 'SkipTest', None) is not None: + raise unittest.SkipTest() + else: + return + t = Task(self.tw, description="test task", due=datetime.datetime.now() - datetime.timedelta(0,2)) t.save() -- 2.39.5