~homeworkprod/byceps

ref: 9f63b62a2b4647a97ebd3b6356d937ffa1d88876 byceps/tests/services/user/test_models_full_name.py -rw-r--r-- 632 bytes
9f63b62a — Jochen Kupperschmidt Note that Python 3.6 is a supported Python version 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""
:Copyright: 2006-2017 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""

from nose2.tools import params

from testfixtures.user import create_user_with_detail


@params(
    (None,          None    , None                ),
    ('Giesbert Z.', None    , 'Giesbert Z.'       ),
    (None,          'Blümli', 'Blümli'            ),
    ('Giesbert Z.', 'Blümli', 'Giesbert Z. Blümli'),
)
def test_full_name(first_names, last_name, expected):
    user = create_user_with_detail(first_names=first_names,
                                   last_name=last_name)

    assert user.detail.full_name == expected