コード例 #1
0
ファイル: tests.py プロジェクト: torypayne/make-it-short
	def test_most_popular_visits(self):
		popular = model.most_popular()
		self.assertGreater(popular[1]["visits"], 0)
コード例 #2
0
ファイル: tests.py プロジェクト: torypayne/make-it-short
	def test_most_popular_code(self):
		popular = model.most_popular()
		self.assertEqual(len(popular[1]["code"]), 6)
コード例 #3
0
ファイル: tests.py プロジェクト: torypayne/make-it-short
	def test_most_popular_len(self):
		popular = model.most_popular()
		self.assertEqual(len(popular), 10)
コード例 #4
0
ファイル: tests.py プロジェクト: torypayne/make-it-short
	def test_most_popular_empty(self):
		popular = model.most_popular()
		self.assertFalse(model.is_empty(popular[1]["url"]))
コード例 #5
0
ファイル: app.py プロジェクト: torypayne/make-it-short
def popular():
	model.db_connect()
	popular = model.most_popular()
	model.db.close()
	return render_template("popular.html", popular=popular)