mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-27 10:07:05 -05:00
feat: Add blog, media, and support apps, implement ride credits and image API, and remove toplist feature.
This commit is contained in:
@@ -15,15 +15,12 @@ from apps.accounts.admin import (
|
||||
CustomUserAdmin,
|
||||
EmailVerificationAdmin,
|
||||
PasswordResetAdmin,
|
||||
TopListAdmin,
|
||||
TopListItemAdmin,
|
||||
UserProfileAdmin,
|
||||
)
|
||||
from apps.accounts.models import (
|
||||
EmailVerification,
|
||||
PasswordReset,
|
||||
TopList,
|
||||
TopListItem,
|
||||
|
||||
User,
|
||||
UserProfile,
|
||||
)
|
||||
@@ -157,51 +154,4 @@ class TestPasswordResetAdmin(TestCase):
|
||||
assert "cleanup_old_tokens" in actions
|
||||
|
||||
|
||||
class TestTopListAdmin(TestCase):
|
||||
"""Tests for TopListAdmin class."""
|
||||
|
||||
def setUp(self):
|
||||
self.factory = RequestFactory()
|
||||
self.site = AdminSite()
|
||||
self.admin = TopListAdmin(model=TopList, admin_site=self.site)
|
||||
|
||||
def test_list_select_related(self):
|
||||
"""Verify select_related for user."""
|
||||
assert "user" in self.admin.list_select_related
|
||||
|
||||
def test_list_prefetch_related(self):
|
||||
"""Verify prefetch_related for items."""
|
||||
assert "items" in self.admin.list_prefetch_related
|
||||
|
||||
def test_publish_actions(self):
|
||||
"""Verify publish actions exist."""
|
||||
request = self.factory.get("/admin/")
|
||||
request.user = UserModel(is_superuser=True)
|
||||
|
||||
actions = self.admin.get_actions(request)
|
||||
assert "publish_lists" in actions
|
||||
assert "unpublish_lists" in actions
|
||||
|
||||
|
||||
class TestTopListItemAdmin(TestCase):
|
||||
"""Tests for TopListItemAdmin class."""
|
||||
|
||||
def setUp(self):
|
||||
self.factory = RequestFactory()
|
||||
self.site = AdminSite()
|
||||
self.admin = TopListItemAdmin(model=TopListItem, admin_site=self.site)
|
||||
|
||||
def test_list_select_related(self):
|
||||
"""Verify select_related for top_list and user."""
|
||||
assert "top_list" in self.admin.list_select_related
|
||||
assert "top_list__user" in self.admin.list_select_related
|
||||
assert "content_type" in self.admin.list_select_related
|
||||
|
||||
def test_reorder_actions(self):
|
||||
"""Verify reorder actions exist."""
|
||||
request = self.factory.get("/admin/")
|
||||
request.user = UserModel(is_superuser=True)
|
||||
|
||||
actions = self.admin.get_actions(request)
|
||||
assert "move_up" in actions
|
||||
assert "move_down" in actions
|
||||
|
||||
Reference in New Issue
Block a user