housekeep: centralize datetime generation

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2022-01-18 05:59:52 -08:00
parent 7bcc8d7ce7
commit 7f6c23d4cb
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
41 changed files with 146 additions and 179 deletions

View file

@ -1,10 +1,8 @@
from datetime import datetime
import pytest
from sqlalchemy.exc import IntegrityError
from aurweb import db
from aurweb import db, time
from aurweb.models.account_type import TRUSTED_USER_ID
from aurweb.models.tu_vote import TUVote
from aurweb.models.tu_voteinfo import TUVoteInfo
@ -27,7 +25,7 @@ def user() -> User:
@pytest.fixture
def tu_voteinfo(user: User) -> TUVoteInfo:
ts = int(datetime.utcnow().timestamp())
ts = time.utcnow()
with db.begin():
tu_voteinfo = db.create(TUVoteInfo, Agenda="Blah blah.",
User=user.Username,