File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change
1
+ import os
1
2
import shutil
2
3
from django .conf import settings
3
4
from django .test import TestCase
8
9
from multipleindex .search_indexes import FooIndex
9
10
from multipleindex .models import Foo , Bar
10
11
12
+ def tearDownModule ():
13
+ # Because Whoosh doesn't clean up its mess.
14
+ for name , opts in settings .HAYSTACK_CONNECTIONS .items ():
15
+ if "WhooshEngine" not in opts ['ENGINE' ]:
16
+ continue
17
+ p = opts ['PATH' ]
18
+ if os .path .exists (p ):
19
+ shutil .rmtree (p )
20
+
11
21
12
22
class MultipleIndexTestCase (TestCase ):
13
23
def setUp (self ):
@@ -46,8 +56,7 @@ def setUp(self):
46
56
def tearDown (self ):
47
57
self .fi .clear ()
48
58
self .bi .clear ()
49
- # Because Whoosh doesn't clean up its mess.
50
- shutil .rmtree (settings .HAYSTACK_CONNECTIONS ['whoosh' ]['PATH' ])
59
+
51
60
super (MultipleIndexTestCase , self ).setUp ()
52
61
53
62
def test_index_update_object_using (self ):
You can’t perform that action at this time.
0 commit comments