add aurweb.time module

This module includes timezone-based utilities for a FastAPI request.
This commit introduces use of the AURTZ cookie within get_request_timezone.
This cookie should be set to the user or session's timezone.

* `make_context` has been modified to parse the request's timezone
  and include the "timezone" and "timezones" variables, along with
  a timezone specified "now" date.
+ Added `Timezone` attribute to aurweb.testing.requests.Request.user.

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-01-25 16:52:14 -08:00
parent 07d5907ecd
commit 9052688ed2
4 changed files with 104 additions and 4 deletions

View file

@ -5,6 +5,7 @@ class User:
""" A fake User model. """
# Fake columns.
LangPreference = aurweb.config.get("options", "default_lang")
Timezone = aurweb.config.get("options", "default_timezone")
# A fake authenticated flag.
authenticated = False