profile: disable title (Civilité) default attribute (#61301)
This commit is contained in:
parent
936e50d70b
commit
ceac0b6892
|
@ -8,7 +8,7 @@ def add_initial_data(apps, schema_editor):
|
|||
AttributeDefinition = apps.get_model('profile', 'AttributeDefinition')
|
||||
|
||||
attributes = [
|
||||
{'label': u'Civilité', 'name': 'title', 'kind': 'title'},
|
||||
{'label': u'Civilité', 'name': 'title', 'kind': 'title', 'disabled': True},
|
||||
{'label': u'Prénom', 'name': 'first_name', 'required': True, 'asked_on_registration': True},
|
||||
{'label': u'Nom', 'name': 'last_name', 'required': True, 'asked_on_registration': True},
|
||||
{'label': u'Adresse électronique', 'name': 'email', 'kind': 'email', 'required': True},
|
||||
|
|
|
@ -57,7 +57,7 @@ def test_authentic_update_settings_from_path(tmpdir):
|
|||
u'title',
|
||||
]
|
||||
|
||||
assert [x['name'] for x in fields if x['disabled']] == [u'country', u'birthdate']
|
||||
assert [x['name'] for x in fields if x['disabled']] == ['country', 'birthdate', 'title']
|
||||
profile_fields = [x['name'] for x in fields if not x['disabled']]
|
||||
assert profile_fields == [
|
||||
u'mobile',
|
||||
|
@ -68,7 +68,6 @@ def test_authentic_update_settings_from_path(tmpdir):
|
|||
u'zipcode',
|
||||
u'city',
|
||||
u'phone',
|
||||
u'title',
|
||||
]
|
||||
|
||||
# serialize hobo.json
|
||||
|
|
|
@ -152,7 +152,7 @@ def test_hobo_deploy(monkeypatch, tenant_base, mocker, skeleton_dir, tmp_path):
|
|||
'required': False,
|
||||
'user_visible': True,
|
||||
'label': u'Civilité',
|
||||
'disabled': False,
|
||||
'disabled': True,
|
||||
'user_editable': True,
|
||||
'asked_on_registration': False,
|
||||
'name': 'title',
|
||||
|
@ -438,8 +438,8 @@ def test_hobo_deploy(monkeypatch, tenant_base, mocker, skeleton_dir, tmp_path):
|
|||
assert policy.accepted_name_id_format == ['uuid']
|
||||
assert policy.default_name_id_format == 'uuid'
|
||||
assert policy.attributes.count() == 16
|
||||
assert policy.attributes.filter(enabled=True).count() == 14
|
||||
assert policy.attributes.filter(enabled=False).count() == 2
|
||||
assert policy.attributes.filter(enabled=True).count() == 13
|
||||
assert policy.attributes.filter(enabled=False).count() == 3
|
||||
assert policy.attributes.filter(name_format='basic').count() == 16
|
||||
assert (
|
||||
policy.attributes.filter(name='is_superuser', attribute_name='django_user_is_superuser').count()
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
{
|
||||
"asked_on_registration": false,
|
||||
"description": "",
|
||||
"disabled": false,
|
||||
"disabled": true,
|
||||
"kind": "title",
|
||||
"label": "Civilit\u00e9",
|
||||
"name": "title",
|
||||
|
|
Loading…
Reference in New Issue