Example #1
0
def test_cohorts_edit_remove_user(factories, pyramid_request):
    user = factories.User(username='******', authority='foo.org')
    cohort = models.FeatureCohort(name='FractalCohort')
    cohort.members.append(user)

    pyramid_request.db.add(cohort)
    pyramid_request.db.flush()

    assert len(cohort.members) == 1

    pyramid_request.matchdict['id'] = cohort.id
    pyramid_request.params['remove'] = user.userid
    cohorts_edit_remove(pyramid_request)

    assert len(cohort.members) == 0
def test_cohorts_edit_remove_user(factories, pyramid_request):
    user = factories.User(username='******', authority='foo.org')
    cohort = models.FeatureCohort(name='FractalCohort')
    cohort.members.append(user)

    pyramid_request.db.add(cohort)
    pyramid_request.db.flush()

    assert len(cohort.members) == 1

    pyramid_request.matchdict['id'] = cohort.id
    pyramid_request.params['remove'] = user.userid
    cohorts_edit_remove(pyramid_request)

    assert len(cohort.members) == 0