Skip to content

Commit

Permalink
Remove last_login migration
Browse files Browse the repository at this point in the history
  • Loading branch information
Guilouf committed Dec 26, 2024
1 parent 469fc1b commit 3373410
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions lemarche/users/tests.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
from datetime import datetime
from importlib import import_module
from io import StringIO
from unittest.mock import patch

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
Expand Down Expand Up @@ -309,16 +307,3 @@ def test_dryrun_warn_command(self):
call_command("anonymize_old_users", dry_run=True, stdout=self.std_out)

self.assertFalse(TemplateTransactionalSendLog.objects.all())

def test_last_login_migration(self):
"""We test the runpython function inside the migration file"""

migration = import_module("lemarche.users.migrations.0043_update_inactive_last_login")

expired_user = User.objects.filter(last_login__lte=self.frozen_last_year)
self.assertTrue(expired_user)

migration.update_last_login(apps, None)

self.assertFalse(User.objects.filter(last_login__lte=self.frozen_last_year))
self.assertEqual(User.objects.filter(last_login__lte=self.frozen_warning_date).count(), 3)

0 comments on commit 3373410

Please sign in to comment.