Skip to content

Commit

Permalink
precommit clean
Browse files Browse the repository at this point in the history
  • Loading branch information
Guilouf committed Dec 26, 2024
1 parent 5482542 commit 1c2c0d5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
12 changes: 5 additions & 7 deletions lemarche/users/management/commands/anonymize_old_users.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
from dateutil.relativedelta import relativedelta
from django.conf import settings
from django.contrib.auth.hashers import UNUSABLE_PASSWORD_PREFIX
from django.contrib.postgres.functions import RandomUUID
from django.core.management.base import BaseCommand
from django.utils import timezone
from django.db import transaction
from django.db.models import F, Value
from django.db.models.functions import Concat
from django.contrib.auth.hashers import UNUSABLE_PASSWORD_PREFIX
from django.contrib.postgres.functions import RandomUUID
from django.conf import settings
from django.template import defaulttags

from dateutil.relativedelta import relativedelta
from django.utils import timezone

from lemarche.conversations.models import TemplateTransactional
from lemarche.users.models import User
Expand Down Expand Up @@ -44,7 +43,6 @@ def add_arguments(self, parser):
)

def handle(self, *args, **options):

expiry_date = timezone.now() - relativedelta(months=options["month_timeout"])
warning_date = expiry_date + relativedelta(days=options["warning_delay"])

Expand Down
13 changes: 6 additions & 7 deletions lemarche/users/tests.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
from datetime import datetime
from importlib import import_module
from io import StringIO
from unittest.mock import patch
from importlib import import_module

from dateutil.relativedelta import relativedelta
from django.apps import apps
from django.core.management import call_command
from django.db.models import F
from django.test import TestCase, override_settings
from django.utils import timezone
from django.db.models import F
from django.core.management import call_command
from django.apps import apps
from dateutil.relativedelta import relativedelta

from lemarche.companies.factories import CompanyFactory
from lemarche.conversations.models import TemplateTransactional, TemplateTransactionalSendLog
from lemarche.favorites.factories import FavoriteListFactory
from lemarche.siaes.factories import SiaeFactory
from lemarche.tenders.factories import TenderFactory
from lemarche.users import constants as user_constants
from lemarche.users.factories import UserFactory
from lemarche.users.models import User
from lemarche.conversations.models import TemplateTransactionalSendLog, TemplateTransactional


class UserModelTest(TestCase):
Expand Down Expand Up @@ -179,7 +179,6 @@ def test_update_related_favorite_list_count_on_save(self):
INACTIVE_USER_WARNING_DELAY_IN_DAYS=7,
)
class UserAnonymizationTestCase(TestCase):

def setUp(self):
frozen_now = datetime(year=2024, month=1, day=1, tzinfo=timezone.utc)
self.frozen_last_year = frozen_now - relativedelta(years=1)
Expand Down

0 comments on commit 1c2c0d5

Please sign in to comment.