add test for group.to_dict() with one member
This commit is contained in:
parent
6bf4d75a60
commit
448692018a
|
@ -38,8 +38,8 @@ def test_group_members(ldap_group, ldap_srv, g_admin):
|
|||
group.remove_member('member1')
|
||||
|
||||
|
||||
def test_group_to_dict(simple_group):
|
||||
group = simple_group
|
||||
def test_group_to_dict(ldap_group, ldap_user):
|
||||
group = ldap_group
|
||||
|
||||
expected = {
|
||||
'cn': group.cn,
|
||||
|
@ -48,3 +48,11 @@ def test_group_to_dict(simple_group):
|
|||
'members': [],
|
||||
}
|
||||
assert group.to_dict() == expected
|
||||
|
||||
group.add_member(ldap_user.uid)
|
||||
expected['members'].append({
|
||||
'uid': ldap_user.uid,
|
||||
'cn': ldap_user.cn,
|
||||
'program': ldap_user.program,
|
||||
})
|
||||
assert group.to_dict() == expected
|
||||
|
|
Loading…
Reference in New Issue