Beispiel #1
0
def test_group_get_membership_for_non_member(group):

    another_group = GroupFactory()

    membership = MembershipFactory(group=another_group)

    assert not group.get_membership(user=membership.member)
Beispiel #2
0
def test_group_contains_non_member(group):

    another_group = GroupFactory()

    membership = MembershipFactory(group=another_group)

    assert membership.member not in group
def test_no_permissions_in_other_groups(user, group, view, request_mock,
                                        membership_type, permission):
    """ Verifies that a permission is only granted inside the given group """
    MembershipFactory(member=user, group=group, type=membership_type)
    other_group = GroupFactory()

    assert group != other_group
    assert not permission.has_object_permission(request_mock, view,
                                                other_group)
def koie_group():
    return GroupFactory(name="Koiene")
def test_access_iterator():
    """Test the access of the group"""

    assert GroupFactory().access == "O"
    assert GroupFactory(access="C").access == "C"
    assert GroupFactory(access="H").access == "H"
def test_slug_generation(group_name, expected):
    """Test that slug is lower-case of group name """

    group = GroupFactory(name=group_name)

    assert group.slug == expected
Beispiel #7
0
def other_group():
    return GroupFactory()
Beispiel #8
0
def test_that_group_category_may_be_set_to_administrative_group():
    """ A group should be able to be set as an administrative group """

    group = GroupFactory(category=GroupCategory.administrative_group)

    assert group.category == GroupCategory.administrative_group
Beispiel #9
0
def test_group_slug_is_correct(name, expected):

    group = GroupFactory(name=name)

    assert group.slug == expected
Beispiel #10
0
def test_group_get_access_status(access, expected):

    group = GroupFactory.build(access=access)

    assert group.get_access_status() == expected
Beispiel #11
0
def group():
    """ Return a default group """

    return GroupFactory()
def koie_group():
    """ Creating group fixture for Koiene, as this specific group is used in the booking payment """
    return GroupFactory(name="Koiene")
def group():
    return GroupFactory()
def sit_group():
    return GroupFactory(name="SiT")