##// END OF EJS Templates
py3: replace list comprehension with for-loop due to scope...
py3: replace list comprehension with for-loop due to scope The scope of the list comprehension variable 'x' will be limited to the list comprehension in python3. Thus switching to a full loop (without this scope restriction) in preparation for python3.

File last commit:

r6614:95e149ed default
r6788:bfd7fc9a default
Show More
test_admin_repo_groups.py
26 lines | 1.1 KiB | text/x-python | PythonLexer
from kallithea.model.db import Repository
from kallithea.model.meta import Session
from kallithea.model.repo_group import RepoGroupModel
from kallithea.tests.base import TestController, url
from kallithea.tests.fixture import Fixture
fixture = Fixture()
class TestRepoGroupsController(TestController):
def test_case_insensitivity(self):
self.log_user()
group_name = u'newgroup'
response = self.app.post(url('repos_groups'),
fixture._get_repo_group_create_params(group_name=group_name,
_authentication_token=self.authentication_token()))
# try to create repo group with swapped case
swapped_group_name = group_name.swapcase()
response = self.app.post(url('repos_groups'),
fixture._get_repo_group_create_params(group_name=swapped_group_name,
_authentication_token=self.authentication_token()))
response.mustcontain('already exists')
RepoGroupModel().delete(group_name)
Session().commit()