Esempio n. 1
0
def test_get_user_project_role():
    user1 = factories.UserFactory()
    user2 = factories.UserFactory()
    project = factories.ProjectFactory()
    role = factories.RoleFactory()
    membership = factories.MembershipFactory(user=user1, project=project, role=role)

    assert services._get_user_project_membership(user1, project) == membership
    assert services._get_user_project_membership(user2, project) is None
Esempio n. 2
0
def test_get_user_project_role():
    user1 = factories.UserFactory()
    user2 = factories.UserFactory()
    project = factories.ProjectFactory()
    role = factories.RoleFactory()
    membership = factories.MembershipFactory(user=user1, project=project, role=role)

    assert services._get_user_project_membership(user1, project) == membership
    assert services._get_user_project_membership(user2, project) is None