Blob Blame History Raw
diff -up Flask-AutoIndex-0.4.1/tests/__init__.py.orig Flask-AutoIndex-0.4.1/tests/__init__.py
--- Flask-AutoIndex-0.4.1/tests/__init__.py.orig	2013-08-11 18:47:54.790493349 -0300
+++ Flask-AutoIndex-0.4.1/tests/__init__.py	2013-08-11 18:48:54.947495653 -0300
@@ -133,11 +133,11 @@ class ApplicationTestCase(unittest.TestC
         self.app = Flask(__name__)
         self.app2 = Flask(__name__ + '2')
         self.idx = AutoIndex(self.app, browse_root, add_url_rules=True)
-        self.idx2 = AutoIndex(self.app2, silk_path='/myicons')
+        self.idx2 = AutoIndex(self.app2, browse_root, silk_path='/myicons')
         #self.idx3 = AutoIndex()
         @self.app2.route('/')
         @self.app2.route('/<path:path>')
-        def autoindex(path='.'):
+        def autoindex_test(path='.'):
             return self.idx2.render_autoindex(path, browse_root)
         #def create_app(__name__):
         #    app = Flask(__name__)
@@ -149,6 +149,7 @@ class ApplicationTestCase(unittest.TestC
         return self.app.test_client().get(path)
 
     def get2(self, path):
+        self.app2.config['TESTING'] = True
         return self.app2.test_client().get(path)
 
     def test_css(self):
@@ -163,9 +164,8 @@ class ApplicationTestCase(unittest.TestC
         assert rv.data == rv2.data
 
     def test_autoindex(self):
-        for get in self.get, self.get2:
-            rv = get('/')
-            assert '__init__.py' in rv.data
+        assert '__init__.py' in self.get('/').data
+        assert '__init__.py' in self.get2('/').data
 
     def test_own_static_file(self):
         rv = self.get('/static/helloworld.txt')