mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
add authenticated User LangPreference tracking
+ Use User.LangPreference when there is no set AURSID if request.user.is_authenticated is true. + Updated post /language to update LangPreference when request.user.is_authenticated. + Restore language during test where we change it. + Added the user attribute to aurweb.testing.requests.Request. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
a33d076d8b
commit
9fdbe3f775
5 changed files with 59 additions and 14 deletions
|
@ -54,7 +54,7 @@ def test_get_passreset():
|
|||
|
||||
|
||||
def test_get_passreset_translation():
|
||||
# Test that translation works.
|
||||
# Test that translation works; set it to de.
|
||||
with client as request:
|
||||
response = request.get("/passreset", cookies={"AURLANG": "de"})
|
||||
|
||||
|
@ -68,6 +68,10 @@ def test_get_passreset_translation():
|
|||
# And the button.
|
||||
assert "Weiter".encode("utf-8") in response.content
|
||||
|
||||
# Restore english.
|
||||
with client as request:
|
||||
response = request.get("/passreset", cookies={"AURLANG": "en"})
|
||||
|
||||
|
||||
def test_get_passreset_with_resetkey():
|
||||
with client as request:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue