[core] Fix TestLoginWithHadoop
@@ -82,12 +82,9 @@ class TestLoginWithHadoop(PseudoHdfsTestBase):
response = self.c.post('/hue/accounts/login/', dict(username=self.test_username, password="foo"))
assert_equal(302, response.status_code, "Expected ok redirect status.")
+ assert_equal(response.url, "/")
assert_true(self.cluster.fs.do_as_user(self.test_username, self.fs.exists, "/user/%s" % self.test_username))
- response = self.c.get('/hue/accounts/login/')
- assert_equal(200, response.status_code, "Expected ok status.")
- assert_false(response.context[0]['first_login_ever'])
-
def test_login_old(self):
response = self.c.get('/accounts/login/')
assert_equal(200, response.status_code, "Expected ok status.")
@@ -98,8 +95,8 @@ class TestLoginWithHadoop(PseudoHdfsTestBase):
assert_true(self.cluster.fs.do_as_user(self.test_username, self.fs.exists, "/user/%s" % self.test_username))
response = self.c.get('/accounts/login/')
- assert_equal(200, response.status_code, "Expected ok status.")
- assert_false(response.context[0]['first_login_ever'])
+ assert_equal(302, response.status_code, "Expected ok redirect status.")
+ assert_equal(response.url, "/")
def test_login_home_creation_failure(self):
response = self.c.get('/hue/accounts/login/')
@@ -210,12 +207,9 @@ class TestLdapLogin(PseudoHdfsTestBase):
})
assert_equal(302, response.status_code, "Expected ok redirect status.")
+ assert_equal(response.url, "/")
assert_true(self.cluster.fs.do_as_user(self.test_username, self.fs.exists, "/user/%s" % self.test_username))
- response = self.c.get('/hue/accounts/login/')
- assert_equal(200, response.status_code, "Expected ok status.")
- assert_false(response.context[0]['first_login_ever'])
-
def test_login_failure_for_bad_username(self):
self.reset.append(conf.LDAP.LDAP_SERVERS.set_for_testing(get_mocked_config()))
@@ -616,10 +610,7 @@ class TestMultipleBackendLoginNoHadoop(object):
'server': "Local"
})
assert_equal(302, response.status_code, "Expected ok redirect status.")
-
- response = self.c.get('/hue/accounts/login/')
- assert_equal(200, response.status_code, "Expected ok status.")
- assert_false(response.context[0]['first_login_ever'])
+ assert_equal(response.url, "/")
self.c.get('/accounts/logout')
@@ -629,6 +620,7 @@ class TestMultipleBackendLoginNoHadoop(object):
'server': "LDAP"
})
assert_equal(302, response.status_code, "Expected ok redirect status.")
+ assert_equal(response.url, "/")
class TestLogin(PseudoHdfsTestBase):
