Exemple #1
0
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()])
Exemple #3
0
    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
Exemple #4
0
    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
Exemple #5
0
 def test1(self):
     """Testing humanize_list filter (length 1)"""
     self.assertEqual(djblets_utils.humanize_list(['a']), 'a')
Exemple #6
0
 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')
Exemple #8
0
 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([]),
                      '')
Exemple #10
0
 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')
Exemple #11
0
 def test1(self):
     """Testing humanize_list filter (length 1)"""
     self.assertEqual(djblets_utils.humanize_list(['a']), 'a')
Exemple #12
0
 def test3(self):
     """Testing humanize_list filter (length 3)"""
     self.assertEqual(djblets_utils.humanize_list(['a', 'b', 'c']),
                      'a, b and c')
Exemple #13
0
 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')
Exemple #15
0
 def test4(self):
     """Testing humanize_list filter (length 4)"""
     self.assertEqual(djblets_utils.humanize_list(["a", "b", "c", "d"]), "a, b, c, and d")
Exemple #16
0
 def test3(self):
     """Testing humanize_list filter (length 3)"""
     self.assertEqual(djblets_utils.humanize_list(["a", "b", "c"]), "a, b and c")
Exemple #17
0
 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')
Exemple #20
0
 def test4(self):
     """Testing humanize_list filter (length 4)"""
     self.assertEqual(djblets_utils.humanize_list(['a', 'b', 'c', 'd']),
                      'a, b, c, and d')
Exemple #21
0
 def test_with_empty_list(self):
     """Testing {{...|humanize_list}} with empty list"""
     self.assertEqual(humanize_list([]), '')
Exemple #22
0
 def test0(self):
     """Testing humanize_list filter (length 0)"""
     self.assertEqual(djblets_utils.humanize_list([]), '')
Exemple #23
0
 def test_with_1_item(self):
     """Testing {{...|humanize_list}} with 1 item"""
     self.assertEqual(humanize_list(['a']), 'a')
Exemple #24
0
 def test2(self):
     """Testing humanize_list filter (length 2)"""
     self.assertEqual(djblets_utils.humanize_list(['a', 'b']), 'a and b')
Exemple #25
0
 def test_with_2_items(self):
     """Testing {{...|humanize_list}} with 2 items"""
     self.assertEqual(humanize_list(['a', 'b']), 'a and b')
Exemple #26
0
 def test4(self):
     """Testing humanize_list filter (length 4)"""
     self.assertEqual(djblets_utils.humanize_list(['a', 'b', 'c', 'd']),
                      'a, b, c, and d')
Exemple #27
0
 def test_with_3_items(self):
     """Testing {{...|humanize_list}} with 3 items"""
     self.assertEqual(humanize_list(['a', 'b', 'c']), 'a, b and c')