diff --git a/lms/djangoapps/certificates/tests/test_api.py b/lms/djangoapps/certificates/tests/test_api.py index df83bb041c..789dafb021 100644 --- a/lms/djangoapps/certificates/tests/test_api.py +++ b/lms/djangoapps/certificates/tests/test_api.py @@ -737,8 +737,11 @@ def set_microsite(domain): """ Execute the function after setting up the microsite. """ - microsite.set_by_domain(domain) - return func(request, *args, **kwargs) + try: + microsite.set_by_domain(domain) + return func(request, *args, **kwargs) + finally: + microsite.clear() return inner return decorator