~unity-2d-team/unity-2d/Shell-MultiMonitor

« back to all changes in this revision

Viewing changes to grackle/tests/test_model.py

  • Committer: William Grant
  • Date: 2012-01-23 00:15:41 UTC
  • Revision ID: william.grant@canonical.com-20120123001541-opi3ememu13hg9jy
Use real UTC timestamps in the archive_message TimeUUIDs. pycassa's end up including the local timezone offset :/

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
from tempfile import _RandomNameSequence
23
23
import time
24
24
import unittest
25
 
import uuid
26
25
 
27
26
from dateutil.tz import (
28
27
    tzoffset,
172
171
        self.assertIs(None, prev)
173
172
        self.assertMessages([], messages)
174
173
        self.assertIs(None, next)
175
 
 
176
 
    def test_date_filter(self):
177
 
        conn, archive = self.makeArchive()
178
 
        self.makeMessages(conn, archive, 10)
179
 
        start = datetime.datetime.utcfromtimestamp(250).replace(
180
 
            tzinfo=tzutc())
181
 
        finish = datetime.datetime.utcfromtimestamp(500).replace(
182
 
            tzinfo=tzutc())
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)