cubicweb/test/unittest_cwconfig.py
changeset 11476 a9f26de5ea6c
parent 11472 bc04039acd2e
child 11478 1817f8946c22
--- a/cubicweb/test/unittest_cwconfig.py	Fri Sep 23 09:51:10 2016 +0200
+++ b/cubicweb/test/unittest_cwconfig.py	Fri Sep 23 13:36:06 2016 +0200
@@ -203,6 +203,15 @@
         from cubes import file
         self.assertEqual(file.__path__, [join(self.custom_cubes_dir, 'file')])
 
+    def test_config_value_from_environment(self):
+        self.assertIsNone(self.config['base-url'])
+        os.environ['CW_BASE_URL'] = 'https://www.cubicweb.org'
+        try:
+            self.assertEqual(self.config['base-url'],
+                             'https://www.cubicweb.org')
+        finally:
+            del os.environ['CW_BASE_URL']
+
 
 class FindPrefixTC(unittest.TestCase):
     def make_dirs(self, *args):