def test__lessThanRelativeDate(self): days = 2 now = DateTime() mydate = now + days expected_dates = [now.earliestTime(), mydate.latestTime()] expected = {'modified': {'query': expected_dates, 'range': 'minmax'}} data = Row(index='modified', operator='_lessThanRelativeDate', values=days) parsed = queryparser._lessThanRelativeDate(MockSite(), data) self.assertEqual(parsed, expected)
def test__lessThanRelativeDate(self): days = 2 now = DateTime() mydate = now + days expected_dates = [now.earliestTime(), mydate.latestTime()] expected = {'modified': {'query': expected_dates, 'range': 'minmax'}} data = Row(index='modified', operator='_lessThanRelativeDate', values=days) parsed = queryparser._lessThanRelativeDate(MockSite(), data) self.assertEqual(parsed, expected)