Testing Model Is Registered On Admin Site
Django - How to test a model is registered on the admin site#
from django.contrib import admin
from django.test import TestCase
from ..models import Account
class ModelAdminTests(TestCase):
def test_account_model_admin(self):
'''Ensure the account is extended from model admin'''
registry = admin.site._registry
self.assertTrue(
isinstance(registry[Account], admin.ModelAdmin)
)