0005-tests-adapt-to-usernames-cut-at-30-characters.patch
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 |
- |