tests: use Attribute.all_objects to get all fields (#22751)
This commit is contained in:
parent
411e94363a
commit
661fd751a6
|
@ -323,23 +323,22 @@ def test_hobo_deploy(tenant_base, settings, mocker, skeleton_dir):
|
|||
assert user.is_superuser is True
|
||||
assert user.is_staff is True
|
||||
from authentic2.models import Attribute
|
||||
assert Attribute.objects.count() == 10
|
||||
assert Attribute.all_objects.count() == 10
|
||||
for field in env['profile']['fields']:
|
||||
if field['name'] != 'email':
|
||||
at = Attribute.objects.get(name=field['name'])
|
||||
at = Attribute.all_objects.get(name=field['name'])
|
||||
assert at.label == field['label']
|
||||
assert at.description == field['description']
|
||||
assert at.kind == field['kind']
|
||||
if field['disabled']:
|
||||
assert at.asked_on_registration is False
|
||||
assert at.user_visible is False
|
||||
assert at.user_editable is False
|
||||
assert at.disabled is True
|
||||
else:
|
||||
assert at.disabled is False
|
||||
assert at.asked_on_registration == \
|
||||
field['asked_on_registration']
|
||||
assert at.user_visible == field['user_visible']
|
||||
assert at.user_editable == field['user_editable']
|
||||
for at in Attribute.objects.all():
|
||||
for at in Attribute.all_objects.all():
|
||||
assert [field for field in env['profile']['fields']
|
||||
if field['name'] == at.name]
|
||||
from authentic2.saml.models import (SPOptionsIdPPolicy,
|
||||
|
|
Loading…
Reference in New Issue