Python django.contrib.auth.admin 模块,UserAdmin() 实例源码

我们从Python开源项目中,提取了以下2个代码示例,用于说明如何使用django.contrib.auth.admin.UserAdmin()

项目:django-hijack-admin    作者:arteria    | 项目源码 | 文件源码
def test_check_custom_user_model_default_admin(self):
            # Django doesn't re-register admins when using `override_settings`,
            # so we have to do it manually in this test case.
            admin.site.register(get_user_model(), UserAdmin)

            warnings = checks.check_custom_user_model(HijackAdminConfig)
            expected_warnings = [
                Warning(
                    'django-hijack-admin does not work out the box with a custom user model.',
                    hint='Please mix HijackUserAdminMixin into your custom UserAdmin.',
                    obj=settings.AUTH_USER_MODEL,
                    id='hijack_admin.W001',
                )
            ]
            self.assertEqual(warnings, expected_warnings)

            admin.site.unregister(get_user_model())
项目:munch-core    作者:crunchmail    | 项目源码 | 文件源码
def get_fieldsets(self, request, obj=None):
        return super(UserAdmin, self).get_fieldsets(request, obj)