def test_dictize_job(self): job = self.enqueue(title=u"Title", queue=u"my_queue") d = jobs.dictize_job(job) assert d[u"id"] == job.id assert d[u"title"] == u"Title" assert d[u"queue"] == u"my_queue" dt = datetime.datetime.strptime(d[u"created"], u"%Y-%m-%dT%H:%M:%S") now = datetime.datetime.utcnow() assert abs((now - dt).total_seconds()) < 10
def test_dictize_job(self): job = self.enqueue(title=u'Title', queue=u'my_queue') d = jobs.dictize_job(job) assert_equal(d[u'id'], job.id) assert_equal(d[u'title'], u'Title') assert_equal(d[u'queue'], u'my_queue') dt = datetime.datetime.strptime(d[u'created'], u'%Y-%m-%dT%H:%M:%S') now = datetime.datetime.utcnow() ok_(abs((now - dt).total_seconds()) < 10)
def test_dictize_job(self): job = self.enqueue(title=u"Title", queue=u"my_queue") d = jobs.dictize_job(job) assert_equal(d[u"id"], job.id) assert_equal(d[u"title"], u"Title") assert_equal(d[u"queue"], u"my_queue") dt = datetime.datetime.strptime(d[u"created"], u"%Y-%m-%dT%H:%M:%S") now = datetime.datetime.utcnow() ok_(abs((now - dt).total_seconds()) < 10)