示例#1
0
文件: post.py 项目: Azula/votabo
 def test_basic(self):
     request = testing.DummyRequest()
     info = post_list(request)
     self.assertEqual(2, len(info["posts"]))
示例#2
0
文件: post.py 项目: Azula/votabo
 def test_nonexist_tag(self):
     request = testing.DummyRequest(GET={"q": u"iasdfasdf"})
     info = post_list(request)
     del info["posts"]
     del info["pager"]
     self.assertDictEqual(info, {'query': u"iasdfasdf"})
示例#3
0
文件: post.py 项目: Azula/votabo
 def test_search_sort_default(self):
     request = testing.DummyRequest(GET={})
     info = post_list(request)
     self.assertGreater(info["posts"][0].id, info["posts"][1].id)
示例#4
0
文件: post.py 项目: Azula/votabo
 def test_search_sort_score(self):
     request = testing.DummyRequest(GET={"q": u"sort:score"})
     info = post_list(request)
     self.assertGreater(info["posts"][0].score, info["posts"][1].score)
示例#5
0
文件: post.py 项目: Azula/votabo
 def test_search(self):
     request = testing.DummyRequest(GET={"q": u"test-tag"})
     info = post_list(request)
     self.assertEqual(2, len(info["posts"]))