Browse Source

Fix tests. Fix "View Profile" link in Subscriptions admin

pull/178/head
Pēteris Caune 7 years ago
parent
commit
8a68ea50dc
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
2 changed files with 2 additions and 7 deletions
  1. +0
    -7
      hc/accounts/tests/test_pruneusers.py
  2. +2
    -0
      hc/payments/admin.py

+ 0
- 7
hc/accounts/tests/test_pruneusers.py View File

@ -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


+ 2
- 0
hc/payments/admin.py View File

@ -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",


Loading…
Cancel
Save