From 8a68ea50dcf0bc78fb52140259479c90dcd3281a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Wed, 9 May 2018 18:56:33 +0300 Subject: [PATCH] Fix tests. Fix "View Profile" link in Subscriptions admin --- hc/accounts/tests/test_pruneusers.py | 7 ------- hc/payments/admin.py | 2 ++ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/hc/accounts/tests/test_pruneusers.py b/hc/accounts/tests/test_pruneusers.py index 546ba8a6..8e4cf0e8 100644 --- a/hc/accounts/tests/test_pruneusers.py +++ b/hc/accounts/tests/test_pruneusers.py @@ -22,13 +22,6 @@ class PruneUsersTestCase(BaseTestCase): self.assertEqual(User.objects.filter(username="charlie").count(), 0) self.assertEqual(Check.objects.count(), 0) - def test_it_removes_old_users_with_zero_checks(self): - self.charlie.date_joined = self.year_ago - self.charlie.last_login = self.year_ago - self.charlie.save() - - Command().handle() - self.assertEqual(User.objects.filter(username="charlie").count(), 0) def test_it_leaves_team_members_alone(self): self.bob.date_joined = self.year_ago diff --git a/hc/payments/admin.py b/hc/payments/admin.py index 70b21e7e..56ec53fb 100644 --- a/hc/payments/admin.py +++ b/hc/payments/admin.py @@ -1,5 +1,6 @@ from django.contrib import admin from django.urls import reverse +from django.utils.safestring import mark_safe from hc.accounts.models import Profile from hc.payments.models import Subscription @@ -20,6 +21,7 @@ class SubsAdmin(admin.ModelAdmin): def email(self, obj): return obj.user.email if obj.user else None + @mark_safe def profile(self, obj): if obj.user.profile: url = reverse("admin:accounts_profile_change",