171
172
self.assertIs(None, prev)
172
173
self.assertMessages([], messages)
173
174
self.assertIs(None, next)
176
def test_date_filter(self):
177
conn, archive = self.makeArchive()
178
self.makeMessages(conn, archive, 10)
179
start = datetime.datetime.utcfromtimestamp(250).replace(
181
finish = datetime.datetime.utcfromtimestamp(500).replace(
183
prev, messages, next = conn.get_messages(
184
archive, 'date', 2, '', start_date=start, finish_date=finish)
185
self.assertMessages([3, 4], messages)
186
prev, messages, next = conn.get_messages(
187
archive, 'date', 2, next, start_date=start, finish_date=finish)
188
self.assertMessages([5], messages)