[web] add test for datadir-url option (related to #5204550)
authorJulien Cristau <julien.cristau@logilab.fr>
Wed, 22 Apr 2015 12:26:44 +0200
changeset 10324 6e44cc1d9c7e
parent 10323 8cc58e8ad72f
child 10325 d2e1e67af4e1
[web] add test for datadir-url option (related to #5204550)
web/test/unittest_web.py
--- a/web/test/unittest_web.py	Wed Apr 01 15:50:59 2015 +0200
+++ b/web/test/unittest_web.py	Wed Apr 22 12:26:44 2015 +0200
@@ -126,17 +126,24 @@
         self.assertIn('HttpOnly', webreq.getheader('set-cookie'))
 
 
-class LogQueriesTC(CubicWebServerTC):
+class MiscOptionsTC(CubicWebServerTC):
     @classmethod
     def init_config(cls, config):
-        super(LogQueriesTC, cls).init_config(config)
+        super(MiscOptionsTC, cls).init_config(config)
         cls.logfile = tempfile.NamedTemporaryFile()
         config.global_set_option('query-log-file', cls.logfile.name)
+        config.global_set_option('datadir-url', '//static.testing.fr/')
+        # call load_configuration again to let the config reset its datadir_url
+        config.load_configuration()
 
     def test_log_queries(self):
         self.web_request()
         self.assertTrue(self.logfile.read())
 
+    def test_datadir_url(self):
+        webreq = self.web_request()
+        self.assertNotIn('/data/', webreq.read())
+
     @classmethod
     def tearDownClass(cls):
         cls.logfile.close()