def reviewer_list(review_request): """ Returns a humanized list of target reviewers in a review request. """ return humanize_list([group.display_name or group.name \ for group in review_request.target_groups.all()] + \ [user.get_full_name() or user.username \ for user in review_request.target_people.all()])
def reviewer_list(review_request): """ Returns a humanized list of target reviewers in a review request. """ return humanize_list([group.display_name or group.name \ for group in review_request.target_groups.all()] + \ [user.get_full_name() or user.username \ for user in review_request.target_people.all()])
def __init__(self, allowed_types=[], msg=None, user_key=None): if allowed_types: msg = _('Unable to authenticate against this repository using one ' 'of the supported authentication types ' '(%(allowed_types)s).') % { 'allowed_types': humanize_list(allowed_types), } elif not msg: msg = _('Unable to authenticate against this repository using one ' 'of the supported authentication types.') SCMError.__init__(self, msg) self.allowed_types = allowed_types self.user_key = user_key
def __init__(self, allowed_types, user_key=None): if allowed_types: msg = _('Unable to authenticate against this repository using one ' 'of the supported authentication types ' '(%(allowed_types)s).') % { 'allowed_types': humanize_list(allowed_types), } else: msg = _('Unable to authenticate against this repository using one ' 'of the supported authentication types.') SCMError.__init__(self, msg) self.allowed_types = allowed_types self.user_key = user_key
def test1(self): """Testing humanize_list filter (length 1)""" self.assertEqual(djblets_utils.humanize_list(['a']), 'a')
def test2(self): """Testing humanize_list filter (length 2)""" self.assertEqual(djblets_utils.humanize_list(['a', 'b']), 'a and b')
def test_with_1_item(self): """Testing {{...|humanize_list}} with 1 item""" self.assertEqual(humanize_list(['a']), 'a')
def test0(self): """Testing humanize_list filter (length 0)""" self.assertEqual(djblets_utils.humanize_list([]), '')
def test_with_empty_list(self): """Testing {{...|humanize_list}} with empty list""" self.assertEqual(humanize_list([]), '')
def test_with_4_items(self): """Testing {{...|humanize_list}} with 4 items""" self.assertEqual(humanize_list(['a', 'b', 'c', 'd']), 'a, b, c, and d')
def test1(self): """Testing humanize_list filter (length 1)""" self.assertEqual(djblets_utils.humanize_list(['a']), 'a')
def test3(self): """Testing humanize_list filter (length 3)""" self.assertEqual(djblets_utils.humanize_list(['a', 'b', 'c']), 'a, b and c')
def test3(self): """Testing humanize_list filter (length 3)""" self.assertEqual(djblets_utils.humanize_list(['a', 'b', 'c']), 'a, b and c')
def test_with_2_items(self): """Testing {{...|humanize_list}} with 2 items""" self.assertEqual(humanize_list(['a', 'b']), 'a and b')
def test4(self): """Testing humanize_list filter (length 4)""" self.assertEqual(djblets_utils.humanize_list(["a", "b", "c", "d"]), "a, b, c, and d")
def test3(self): """Testing humanize_list filter (length 3)""" self.assertEqual(djblets_utils.humanize_list(["a", "b", "c"]), "a, b and c")
def test2(self): """Testing humanize_list filter (length 2)""" self.assertEqual(djblets_utils.humanize_list(["a", "b"]), "a and b")
def test_with_4_items(self): """Testing {{...|humanize_list}} with 4 items""" self.assertEqual(humanize_list(['a', 'b', 'c', 'd']), 'a, b, c, and d')
def test_with_3_items(self): """Testing {{...|humanize_list}} with 3 items""" self.assertEqual(humanize_list(['a', 'b', 'c']), 'a, b and c')
def test4(self): """Testing humanize_list filter (length 4)""" self.assertEqual(djblets_utils.humanize_list(['a', 'b', 'c', 'd']), 'a, b, c, and d')
def test_with_empty_list(self): """Testing {{...|humanize_list}} with empty list""" self.assertEqual(humanize_list([]), '')
def test0(self): """Testing humanize_list filter (length 0)""" self.assertEqual(djblets_utils.humanize_list([]), '')
def test_with_1_item(self): """Testing {{...|humanize_list}} with 1 item""" self.assertEqual(humanize_list(['a']), 'a')
def test2(self): """Testing humanize_list filter (length 2)""" self.assertEqual(djblets_utils.humanize_list(['a', 'b']), 'a and b')
def test_with_2_items(self): """Testing {{...|humanize_list}} with 2 items""" self.assertEqual(humanize_list(['a', 'b']), 'a and b')
def test4(self): """Testing humanize_list filter (length 4)""" self.assertEqual(djblets_utils.humanize_list(['a', 'b', 'c', 'd']), 'a, b, c, and d')
def test_with_3_items(self): """Testing {{...|humanize_list}} with 3 items""" self.assertEqual(humanize_list(['a', 'b', 'c']), 'a, b and c')