|
@@ -20,6 +20,7 @@ import desktop
|
|
|
import desktop.urls
|
|
import desktop.urls
|
|
|
import desktop.conf
|
|
import desktop.conf
|
|
|
import logging
|
|
import logging
|
|
|
|
|
+import os
|
|
|
import time
|
|
import time
|
|
|
|
|
|
|
|
import desktop.views as views
|
|
import desktop.views as views
|
|
@@ -138,6 +139,11 @@ def test_dump_config():
|
|
|
response = client_not_me.get('/dump_config')
|
|
response = client_not_me.get('/dump_config')
|
|
|
assert_equal("You must be a superuser.", response.content)
|
|
assert_equal("You must be a superuser.", response.content)
|
|
|
|
|
|
|
|
|
|
+ os.environ["HUE_CONF_DIR"] = "/tmp/test_hue_conf_dir"
|
|
|
|
|
+ resp = c.get('/dump_config')
|
|
|
|
|
+ del os.environ["HUE_CONF_DIR"]
|
|
|
|
|
+ assert_true('/tmp/test_hue_conf_dir' in resp.content, resp)
|
|
|
|
|
+
|
|
|
|
|
|
|
|
def test_prefs():
|
|
def test_prefs():
|
|
|
c = make_logged_in_client()
|
|
c = make_logged_in_client()
|
|
@@ -409,6 +415,12 @@ def test_config_check():
|
|
|
assert_true('klingon' in resp.content, resp)
|
|
assert_true('klingon' in resp.content, resp)
|
|
|
assert_true('Encoding not supported' in resp.content, resp)
|
|
assert_true('Encoding not supported' in resp.content, resp)
|
|
|
|
|
|
|
|
|
|
+ # Set HUE_CONF_DIR and make sure check_config returns appropriate conf
|
|
|
|
|
+ os.environ["HUE_CONF_DIR"] = "/tmp/test_hue_conf_dir"
|
|
|
|
|
+ resp = cli.get('/debug/check_config')
|
|
|
|
|
+ del os.environ["HUE_CONF_DIR"]
|
|
|
|
|
+ assert_true('/tmp/test_hue_conf_dir' in resp.content, resp)
|
|
|
|
|
+
|
|
|
# Alert present in the status bar
|
|
# Alert present in the status bar
|
|
|
resp = cli.get('/about', follow=True)
|
|
resp = cli.get('/about', follow=True)
|
|
|
assert_true('misconfiguration' in resp.content, resp.content)
|
|
assert_true('misconfiguration' in resp.content, resp.content)
|