--- a/cubicweb/test/unittest_cwconfig.py Thu Jan 14 18:17:23 2016 +0100
+++ b/cubicweb/test/unittest_cwconfig.py Mon Jan 18 09:23:07 2016 +0100
@@ -218,5 +218,17 @@
prefix = tempfile.tempdir
self.assertEqual(_find_prefix(prefix), sys.prefix)
+ @with_tempdir
+ def test_virtualenv(self):
+ venv = os.environ.get('VIRTUAL_ENV')
+ try:
+ prefix = os.environ['VIRTUAL_ENV'] = tempfile.tempdir
+ self.make_dirs('share', 'cubicweb')
+ self.assertEqual(_find_prefix(), prefix)
+ finally:
+ if venv:
+ os.environ['VIRTUAL_ENV'] = venv
+
+
if __name__ == '__main__':
unittest_main()