def setup_class(cls): # Simulate first login ever User.objects.all().delete() PseudoHdfsTestBase.setup_class() cls.auth_backends = settings.AUTHENTICATION_BACKENDS settings.AUTHENTICATION_BACKENDS = ('desktop.auth.backend.AllowFirstUserDjangoBackend',)
def setup_class(cls): # Simulate first login ever User.objects.all().delete() PseudoHdfsTestBase.setup_class() cls.auth_backends = settings.AUTHENTICATION_BACKENDS settings.AUTHENTICATION_BACKENDS = ('desktop.auth.backend.RemoteUserDjangoBackend',) cls.remote_user_middleware_header = middleware.HueRemoteUserMiddleware.header middleware.HueRemoteUserMiddleware.header = conf.AUTH.REMOTE_USER_HEADER.get()
def setup_class(cls): PseudoHdfsTestBase.setup_class() from desktop.auth import backend cls.ldap_backend = backend.LdapBackend backend.LdapBackend = MockLdapBackend MockLdapBackend.__name__ = 'LdapBackend' cls.old_backend = settings.AUTHENTICATION_BACKENDS settings.AUTHENTICATION_BACKENDS = ("desktop.auth.backend.LdapBackend",)
def setup_class(cls): PseudoHdfsTestBase.setup_class() cls.backend = django_auth_ldap_backend.LDAPBackend django_auth_ldap_backend.LDAPBackend = MockLdapBackend # Need to recreate LdapBackend class with new monkey patched base class reload(backend) cls.old_backends = settings.AUTHENTICATION_BACKENDS settings.AUTHENTICATION_BACKENDS = ("desktop.auth.backend.LdapBackend",)
def setup_class(cls): # Simulate first login ever User.objects.all().delete() PseudoHdfsTestBase.setup_class() cls.ldap_backend = django_auth_ldap_backend.LDAPBackend django_auth_ldap_backend.LDAPBackend = MockLdapBackend # Override auth backend, settings are only loaded from conf at initialization so we can't use set_for_testing cls.auth_backends = settings.AUTHENTICATION_BACKENDS settings.AUTHENTICATION_BACKENDS = ('desktop.auth.backend.LdapBackend','desktop.auth.backend.AllowFirstUserDjangoBackend') # Need to recreate LdapBackend class with new monkey patched base class reload(backend)