Projet

Général

Profil

0005-tests-adapt-to-usernames-cut-at-30-characters.patch

Frédéric Péters, 07 mai 2015 11:33

Télécharger (1,19 ko)

Voir les différences:

Subject: [PATCH 5/5] tests: adapt to usernames cut at 30 characters

 tests/test_default_adapter.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/test_default_adapter.py
21 21
def test_format_username(settings):
22 22
    adapter = DefaultAdapter()
23 23
    assert adapter.format_username(idp, {}) == None
24
    assert adapter.format_username(idp, saml_attributes) == 'x'*32 + '@saml'
24
    assert adapter.format_username(idp, saml_attributes) == ('x'*32 + '@saml')[:30]
25 25
    settings.MELLON_USERNAME_TEMPLATE = '{attributes[name_id_content]}'
26
    assert adapter.format_username(idp, saml_attributes) == 'x'*32
26
    assert adapter.format_username(idp, saml_attributes) == ('x'*32)[:30]
27 27
    settings.MELLON_USERNAME_TEMPLATE = '{attributes[username][0]}'
28 28
    assert adapter.format_username(idp, saml_attributes) == 'foobar'
29 29

  
30
-