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:
Kevin Morris 2022-01-18 03:06:17 -08:00
parent fca175ed84
commit 211ca5e49c
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
16 changed files with 159 additions and 159 deletions

View file

@ -10,7 +10,7 @@ import pytest
from fastapi.testclient import TestClient
from aurweb import config, db, util
from aurweb import config, db, filters
from aurweb.models.account_type import DEVELOPER_ID, AccountType
from aurweb.models.tu_vote import TUVote
from aurweb.models.tu_voteinfo import TUVoteInfo
@ -130,7 +130,7 @@ def test_tu_index_guest(client):
response = request.get("/tu", allow_redirects=False, headers=headers)
assert response.status_code == int(HTTPStatus.SEE_OTHER)
params = util.urlencode({"next": "/tu"})
params = filters.urlencode({"next": "/tu"})
assert response.headers.get("location") == f"/login?{params}"