Permalink
Browse files

Now it really tests ``kotti.search_content`` setting override

  • Loading branch information...
1 parent 10cbf6d commit b06989d800f7e2a0687a2a20e7be32294e0441c9 @teixas teixas committed May 24, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 kotti/tests/test_app.py
View
@@ -30,6 +30,9 @@ def _includeme_layout(config):
def _login_view(request):
return {} # pragma: no cover
+def _dummy_search(search_term, request):
+ return u"Not found. Sorry!"
+
class TestApp(UnitTestBase):
def required_settings(self):
return {'sqlalchemy.url': testing_db_url(),
@@ -207,7 +210,9 @@ def test_setting_values_as_unicode(self):
def test_search_content(self):
from kotti import main
+ from kotti.views.util import search_content
settings = self.required_settings()
- settings['kotti.search_content'] = 'kotti.views.util.default_search_content'
+ settings['kotti.search_content'] = 'kotti.tests.test_app._dummy_search'
main({}, **settings)
+ assert search_content(u"Nuno") == u"Not found. Sorry!"

0 comments on commit b06989d

Please sign in to comment.