This changeset removes the PY_TIMEZONE configuration variable and updates all references to it to refer directly to pytz.utc instead. It also cleans up a few of the import statements and removes those that are no longer needed (like the current_app reference from Flask).
Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
Previously this was duplicated between the "two_factor" and the
"webauthn" views, and required more test setup. This DRYs up the
check and tests it once, using mocks to simplify the view tests.
As part of DRYing up the check into a util module, I've also moved
the "is_less_than_days_ago" function it uses.