diff --git a/ca/django_ca/tests/base.py b/ca/django_ca/tests/base.py
index <HASH>..<HASH> 100644
--- a/ca/django_ca/tests/base.py
+++ b/ca/django_ca/tests/base.py
@@ -69,6 +69,22 @@ class DjangoCATestCase(TestCase):
         if cls._overridden_settings:
             reload_module(ca_settings)
 
+    @classmethod
+    def tearDownClass(cls):
+        overridden = False
+        ca_dir = None
+        if hasattr(cls, '_cls_overridden_context'):
+            overridden = True
+            ca_dir = cls._cls_overridden_context.options.get('CA_DIR')
+
+        super(DjangoCATestCase, cls).tearDownClass()
+
+        if overridden is True:
+            reload_module(ca_settings)
+            if ca_dir is not None:
+                shutil.rmtree(ca_dir)
+
+
     def setUp(self):
         reload_module(ca_settings)
add tearDown class so that everything is disabled/removed again