##// END OF EJS Templates
follow Python conventions for boolean values...
follow Python conventions for boolean values True and False might be singletons and the "default" values for "boolean" expressions, but "all" values in Python has a boolean value and should be evaluated as such. Checking with 'is True' and 'is False' is thus confusing, error prone and unnessarily complex. If we anywhere rely and nullable boolean fields from the database layer and don't want the null value to be treated as False then we should check explicitly for null with 'is None'.

File last commit:

r3039:a520d542 beta
r3625:260a7a01 beta
Show More
test_shortlog.py
65 lines | 2.9 KiB | text/x-python | PythonLexer
renamed project to rhodecode
r547 from rhodecode.tests import *
Implemented file history page for showing detailed changelog for a given file...
r3039
renamed project to rhodecode
r547 class TestShortlogController(TestController):
Implemented file history page for showing detailed changelog for a given file...
r3039 def test_index_hg(self):
self.log_user()
response = self.app.get(url(controller='shortlog', action='index',
repo_name=HG_REPO))
# Test response...
def test_index_git(self):
self.log_user()
response = self.app.get(url(controller='shortlog', action='index',
repo_name=GIT_REPO))
# Test response...
def test_index_hg_with_filenode(self):
self.log_user()
response = self.app.get(url(controller='shortlog', action='index',
revision='tip', f_path='/vcs/exceptions.py',
repo_name=HG_REPO))
#history commits messages
response.mustcontain('Added exceptions module, this time for real')
response.mustcontain('Added not implemented hg backend test case')
response.mustcontain('Added BaseChangeset class')
# Test response...
def test_index_git_with_filenode(self):
renamed project to rhodecode
r547 self.log_user()
Implemented file history page for showing detailed changelog for a given file...
r3039 response = self.app.get(url(controller='shortlog', action='index',
revision='tip', f_path='/vcs/exceptions.py',
repo_name=GIT_REPO))
#history commits messages
response.mustcontain('Added exceptions module, this time for real')
response.mustcontain('Added not implemented hg backend test case')
response.mustcontain('Added BaseChangeset class')
def test_index_hg_with_filenode_that_is_dirnode(self):
self.log_user()
response = self.app.get(url(controller='shortlog', action='index',
revision='tip', f_path='/tests',
repo_name=HG_REPO))
self.assertEqual(response.status, '302 Found')
def test_index_git_with_filenode_that_is_dirnode(self):
self.log_user()
response = self.app.get(url(controller='shortlog', action='index',
revision='tip', f_path='/tests',
repo_name=GIT_REPO))
self.assertEqual(response.status, '302 Found')
def test_index_hg_with_filenode_not_existing(self):
self.log_user()
response = self.app.get(url(controller='shortlog', action='index',
revision='tip', f_path='/wrong_path',
repo_name=HG_REPO))
self.assertEqual(response.status, '302 Found')
def test_index_git_with_filenode_not_existing(self):
self.log_user()
response = self.app.get(url(controller='shortlog', action='index',
revision='tip', f_path='/wrong_path',
repo_name=GIT_REPO))
self.assertEqual(response.status, '302 Found')