annotate pylons_app/tests/functional/test_search.py @ 464:cbe777be5b8c

some more basic tests
author Marcin Kuzminski <marcin@python-works.com>
date Tue, 07 Sep 2010 01:39:12 +0200
parents b153a51b1d3b
children e94f4e54dc03
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
406
b153a51b1d3b Implemented search using whoosh. Still as experimental option.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
1 from pylons_app.tests import *
b153a51b1d3b Implemented search using whoosh. Still as experimental option.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
2
b153a51b1d3b Implemented search using whoosh. Still as experimental option.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
3 class TestSearchController(TestController):
b153a51b1d3b Implemented search using whoosh. Still as experimental option.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
4
b153a51b1d3b Implemented search using whoosh. Still as experimental option.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
5 def test_index(self):
464
cbe777be5b8c some more basic tests
Marcin Kuzminski <marcin@python-works.com>
parents: 406
diff changeset
6 self.log_user()
406
b153a51b1d3b Implemented search using whoosh. Still as experimental option.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
7 response = self.app.get(url(controller='search', action='index'))
464
cbe777be5b8c some more basic tests
Marcin Kuzminski <marcin@python-works.com>
parents: 406
diff changeset
8 print response.body
cbe777be5b8c some more basic tests
Marcin Kuzminski <marcin@python-works.com>
parents: 406
diff changeset
9 assert 'class="small" id="q" name="q" type="text"' in response.body,'Search box content error'
406
b153a51b1d3b Implemented search using whoosh. Still as experimental option.
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
10 # Test response...
464
cbe777be5b8c some more basic tests
Marcin Kuzminski <marcin@python-works.com>
parents: 406
diff changeset
11
cbe777be5b8c some more basic tests
Marcin Kuzminski <marcin@python-works.com>
parents: 406
diff changeset
12 def test_empty_search(self):
cbe777be5b8c some more basic tests
Marcin Kuzminski <marcin@python-works.com>
parents: 406
diff changeset
13 self.log_user()
cbe777be5b8c some more basic tests
Marcin Kuzminski <marcin@python-works.com>
parents: 406
diff changeset
14 response = self.app.get(url(controller='search', action='index'),{'q':'vcs_test'})
cbe777be5b8c some more basic tests
Marcin Kuzminski <marcin@python-works.com>
parents: 406
diff changeset
15 assert 'There is no index to search in. Please run whoosh indexer' in response.body,'No error message about empty index'