mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
housekeep: define filters in their own modules
This patch cleans up aurweb.templates and removes direct module-level initialization of the environment. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
fca175ed84
commit
211ca5e49c
16 changed files with 159 additions and 159 deletions
|
@ -1,5 +1,5 @@
|
|||
""" Test our l10n module. """
|
||||
from aurweb import l10n
|
||||
from aurweb import filters, l10n
|
||||
from aurweb.testing.requests import Request
|
||||
|
||||
|
||||
|
@ -43,8 +43,10 @@ def test_tn_filter():
|
|||
request.cookies["AURLANG"] = "en"
|
||||
context = {"language": "en", "request": request}
|
||||
|
||||
translated = l10n.tn(context, 1, "%d package found.", "%d packages found.")
|
||||
translated = filters.tn(context, 1, "%d package found.",
|
||||
"%d packages found.")
|
||||
assert translated == "%d package found."
|
||||
|
||||
translated = l10n.tn(context, 2, "%d package found.", "%d packages found.")
|
||||
translated = filters.tn(context, 2, "%d package found.",
|
||||
"%d packages found.")
|
||||
assert translated == "%d packages found."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue