From f1668c3e55b21bded812bb8b9104ebbbde04a925 Mon Sep 17 00:00:00 2001 From: Jeremy Bowman Date: Mon, 22 Oct 2018 14:48:28 -0400 Subject: [PATCH] TE-2790 Fix microsite config leak in tests --- lms/djangoapps/certificates/tests/test_api.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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