See #212: record user last activity date

This commit is contained in:
Eliot Berriot 2018-06-17 17:53:40 +02:00
parent 307959dfa6
commit 2e4f862387
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
7 changed files with 93 additions and 0 deletions

View file

@ -7,6 +7,7 @@ import pytest
import requests_mock
from django.contrib.auth.models import AnonymousUser
from django.core.cache import cache as django_cache
from django.utils import timezone
from django.test import client
from dynamic_preferences.registries import global_preferences_registry
from rest_framework import fields as rest_fields
@ -250,3 +251,10 @@ def to_api_date():
raise ValueError("Invalid value: {}".format(value))
return inner
@pytest.fixture()
def now(mocker):
now = timezone.now()
mocker.patch("django.utils.timezone.now", return_value=now)
return now