diff --git a/product/ERP5Type/tests/ERP5TypeTestCase.py b/product/ERP5Type/tests/ERP5TypeTestCase.py
index ab0deafdd1a3536ab85e9e2147e36148df17548c..dc20d6424064ecbdb6a998e5e80e840ce8b861a8 100644
--- a/product/ERP5Type/tests/ERP5TypeTestCase.py
+++ b/product/ERP5Type/tests/ERP5TypeTestCase.py
@@ -19,7 +19,10 @@ import Globals
 original_get_request = Globals.get_request
 
 def get_request():
-  return current_app.REQUEST
+  if current_app is not None:
+    return current_app.REQUEST
+  else:
+    return None
 
 Products.ERP5Type.Utils.get_request = get_request
 Globals.get_request = get_request