penguin/AstroJS

Javascript framework for my blog

commit 27542b133c38ef176cf74dbf863401dd8325b4d8

author斟酌 鵬兄 <tgckpg@gmail.com>
date2022-08-02T13:51:38Z
subjectBypass Celery for UNIT_TEST
commit 27542b133c38ef176cf74dbf863401dd8325b4d8
Author: 斟酌 鵬兄 <tgckpg@gmail.com>
Date:   2022-08-02T13:51:38Z

    Bypass Celery for UNIT_TEST
---
 botanjs/service/jwork.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/botanjs/service/jwork.py b/botanjs/service/jwork.py
index a0aacc8..6d6c182 100644
--- a/botanjs/service/jwork.py
+++ b/botanjs/service/jwork.py
@@ -2,7 +2,11 @@
 import os
 from botanjs.classmap import ClassMap
 
-CeleryExists = True 
+if os.getenv( "UNIT_TEST" ) == "1":
+	CeleryExists =  False
+else:
+	CeleryExists = True
+
 try:
 	from celery import Celery
 except ImportError: