From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
update test case.
when the user access kimchi firt time, root.get will redirect to
login.html instead of kimchi-ui.html.
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
tests/test_rest.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tests/test_rest.py b/tests/test_rest.py
index 18ba66e..6aa5348 100644
--- a/tests/test_rest.py
+++ b/tests/test_rest.py
@@ -131,13 +131,17 @@ def test_accepts(self):
If neither of the above, HTTP:406
"""
resp = self.request("/", headers={})
+ location = resp.getheader('location')
+ self.assertTrue(location.endswith("login.html"))
+ resp = self.request("/login.html", headers={})
self.assertTrue('<!doctype html>' in resp.read().lower())
resp = self.request("/", headers={'Accept':
'application/json'})
self.assertValidJSON(resp.read())
resp = self.request("/", headers={'Accept':
'text/html'})
- self.assertTrue('<!doctype html>' in resp.read().lower())
+ location = resp.getheader('location')
+ self.assertTrue(location.endswith("login.html"))
resp = self.request("/", headers={'Accept':
'application/json, text/html'})
--
1.9.3