|
@@ -237,12 +237,13 @@ def test_dump_config():
|
|
|
response = client_not_me.get(reverse('desktop.views.dump_config'))
|
|
response = client_not_me.get(reverse('desktop.views.dump_config'))
|
|
|
assert_true("You must be a superuser" in response.content, response.content)
|
|
assert_true("You must be a superuser" in response.content, response.content)
|
|
|
|
|
|
|
|
|
|
+ prev_env_conf = os.environ["HUE_CONF_DIR"]
|
|
|
try:
|
|
try:
|
|
|
os.environ["HUE_CONF_DIR"] = "/tmp/test_hue_conf_dir"
|
|
os.environ["HUE_CONF_DIR"] = "/tmp/test_hue_conf_dir"
|
|
|
resp = c.get(reverse('desktop.views.dump_config'))
|
|
resp = c.get(reverse('desktop.views.dump_config'))
|
|
|
assert_true('/tmp/test_hue_conf_dir' in resp.content, resp)
|
|
assert_true('/tmp/test_hue_conf_dir' in resp.content, resp)
|
|
|
finally:
|
|
finally:
|
|
|
- del os.environ["HUE_CONF_DIR"]
|
|
|
|
|
|
|
+ os.environ["HUE_CONF_DIR"] = prev_env_conf
|
|
|
|
|
|
|
|
def hue_version():
|
|
def hue_version():
|
|
|
global HUE_VERSION
|
|
global HUE_VERSION
|
|
@@ -755,6 +756,7 @@ def test_config_check():
|
|
|
for old_conf in reset:
|
|
for old_conf in reset:
|
|
|
old_conf()
|
|
old_conf()
|
|
|
|
|
|
|
|
|
|
+ prev_env_conf = os.environ["HUE_CONF_DIR"]
|
|
|
try:
|
|
try:
|
|
|
# Set HUE_CONF_DIR and make sure check_config returns appropriate conf
|
|
# Set HUE_CONF_DIR and make sure check_config returns appropriate conf
|
|
|
os.environ["HUE_CONF_DIR"] = "/tmp/test_hue_conf_dir"
|
|
os.environ["HUE_CONF_DIR"] = "/tmp/test_hue_conf_dir"
|
|
@@ -769,7 +771,7 @@ def test_config_check():
|
|
|
resp = cli.get('/desktop/debug/check_config')
|
|
resp = cli.get('/desktop/debug/check_config')
|
|
|
assert_true('/tmp/test_hue_conf_dir' in resp.content, resp)
|
|
assert_true('/tmp/test_hue_conf_dir' in resp.content, resp)
|
|
|
finally:
|
|
finally:
|
|
|
- del os.environ["HUE_CONF_DIR"]
|
|
|
|
|
|
|
+ os.environ["HUE_CONF_DIR"] = prev_env_conf
|
|
|
desktop.views.validate_by_spec = desktop.views.real_validate_by_spec
|
|
desktop.views.validate_by_spec = desktop.views.real_validate_by_spec
|
|
|
|
|
|
|
|
def test_last_access_time():
|
|
def test_last_access_time():
|