Show More
@@ -1151,7 +1151,7 b' class InitialsGravatar(object):' | |||
|
1151 | 1151 | |
|
1152 | 1152 | # check if prefix is maybe a 'first_name.last_name' syntax |
|
1153 | 1153 | _dot_split = prefix.rsplit('.', 1) |
|
1154 | if len(_dot_split) == 2: | |
|
1154 | if len(_dot_split) == 2 and _dot_split[1]: | |
|
1155 | 1155 | initials = [_dot_split[0][0], _dot_split[1][0]] |
|
1156 | 1156 | else: |
|
1157 | 1157 | initials = [prefix[0], server[0]] |
@@ -281,6 +281,7 b' def test_gravatar_url_builder(tmpl_url, ' | |||
|
281 | 281 | ('admin@', 'Marcin', 'Śuzminski', 'MS', '#aa00ff'), |
|
282 | 282 | ('marcin.śuzminski', '', '', 'MS', '#402020'), |
|
283 | 283 | ('null', '', '', 'NL', '#8c4646'), |
|
284 | ('some.@abc.com', 'some', '', 'SA', '#664e33') | |
|
284 | 285 | ]) |
|
285 | 286 | def test_initials_gravatar_pick_of_initials_and_color_algo( |
|
286 | 287 | email, first_name, last_name, expected_initials, expected_color): |
General Comments 0
You need to be logged in to leave comments.
Login now