示例#1
0
 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
示例#2
0
文件: test_jobs.py 项目: wardi/ckan
 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)
示例#3
0
 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)
示例#4
0
 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)