MCPcopy
hub / github.com/django/django / test_custom_adminsite

Method test_custom_adminsite

tests/admin_checks/tests.py:262–273  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

260 self.assertEqual(admin.checks.check_dependencies(), [])
261
262 def test_custom_adminsite(self):
263 class CustomAdminSite(admin.AdminSite):
264 pass
265
266 custom_site = CustomAdminSite()
267 custom_site.register(Song, MyAdmin)
268 try:
269 errors = checks.run_checks()
270 expected = ["error!"]
271 self.assertEqual(errors, expected)
272 finally:
273 custom_site.unregister(Song)
274
275 def test_allows_checks_relying_on_other_modeladmins(self):
276 class MyBookAdmin(admin.ModelAdmin):

Callers

nothing calls this directly

Calls 4

CustomAdminSiteClass · 0.70
registerMethod · 0.45
run_checksMethod · 0.45
unregisterMethod · 0.45

Tested by

no test coverage detected