diff rhodecode/tests/functional/test_search.py @ 2644:bed929b24f63 beta

fixed tests for search - was written for just mercurial repo without having git
author Marcin Kuzminski <marcin@python-works.com>
date Sat, 21 Jul 2012 14:08:08 +0200
parents 2ad50c44b025
children 82fb2a161ddf
line wrap: on
line diff
--- a/rhodecode/tests/functional/test_search.py	Sat Jul 21 08:20:32 2012 +0200
+++ b/rhodecode/tests/functional/test_search.py	Sat Jul 21 14:08:08 2012 +0200
@@ -27,7 +27,7 @@
         self.log_user()
         response = self.app.get(url(controller='search', action='index'),
                                 {'q': 'def repo'})
-        response.mustcontain('10 results')
+        response.mustcontain('39 results')
 
     def test_repo_search(self):
         self.log_user()
@@ -41,13 +41,24 @@
         response = self.app.get(url(controller='search', action='index'),
                                 {'q': 'last:t', 'type': 'commit'})
 
-        response.mustcontain('1 results')
+        response.mustcontain('2 results')
 
     def test_search_commit_message(self):
         self.log_user()
         response = self.app.get(url(controller='search', action='index'),
-                                {'q': 'bother to ask where to fetch repo during tests',
-                                 'type': 'commit'})
+                    {'q': 'bother to ask where to fetch repo during tests',
+                     'type': 'commit'})
+
+        response.mustcontain('2 results')
+        response.mustcontain('a00c1b6f5d7a6ae678fd553a8b81d92367f7ecf1')
+        response.mustcontain('c6eb379775c578a95dad8ddab53f963b80894850')
+
+    def test_search_commit_message_hg_repo(self):
+        self.log_user()
+        response = self.app.get(url(controller='search', action='index',
+                                    search_repo=HG_REPO),
+                    {'q': 'bother to ask where to fetch repo during tests',
+                     'type': 'commit'})
 
         response.mustcontain('1 results')
         response.mustcontain('a00c1b6f5d7a6ae678fd553a8b81d92367f7ecf1')
@@ -66,13 +77,16 @@
                                 {'q': 'added:README.rst',
                                  'type': 'commit'})
 
-        response.mustcontain('1 results')
+        response.mustcontain('2 results')
+        #HG
         response.mustcontain('3803844fdbd3b711175fc3da9bdacfcd6d29a6fb')
+        #GIT
+        response.mustcontain('ff7ca51e58c505fec0dd2491de52c622bb7a806b')
 
     def test_search_author(self):
         self.log_user()
         response = self.app.get(url(controller='search', action='index'),
-                                {'q': 'author:marcin@python-blog.com raw_id:b986218ba1c9b0d6a259fac9b050b1724ed8e545',
-                                 'type': 'commit'})
+                    {'q': 'author:marcin@python-blog.com raw_id:b986218ba1c9b0d6a259fac9b050b1724ed8e545',
+                     'type': 'commit'})
 
         response.mustcontain('1 results')