Move template filters and globals into blueprint (#301)

* Move 8 of 9 template filters and globals into a blueprint

* Rename nyaa.filters -> nyaa.template_utils

* Fix import sorting
This commit is contained in:
Kfir Hadas
2017-07-23 22:30:41 +03:00
parent 50529920bd
commit f3b923ccca
3 changed files with 114 additions and 102 deletions

View File

@@ -4,11 +4,12 @@ import datetime
from email.utils import formatdate
from tests import NyaaTestCase
from nyaa.routes import (_jinja2_filter_rfc822, _jinja2_filter_rfc822_es, get_utc_timestamp,
get_display_time, timesince, filter_truthy, category_name)
from nyaa.routes import category_name
from nyaa.template_utils import (_jinja2_filter_rfc822, _jinja2_filter_rfc822_es, get_utc_timestamp,
get_display_time, timesince, filter_truthy)
class TestFilters(NyaaTestCase):
class TestTemplateUtils(NyaaTestCase):
# def setUp(self):
# self.db, nyaa.app.config['DATABASE'] = tempfile.mkstemp()