def test_cohorts_index_with_cohorts(pyramid_request): cohort1 = models.FeatureCohort(name='cohort1') cohort2 = models.FeatureCohort(name='cohort2') pyramid_request.db.add(cohort1) pyramid_request.db.add(cohort2) pyramid_request.db.flush() result = views.cohorts_index({}, pyramid_request) assert len(result["results"]) == 2
def test_cohorts_index_with_cohorts(req): cohort1 = models.FeatureCohort(name='cohort1') cohort2 = models.FeatureCohort(name='cohort2') req.db.add(cohort1) req.db.add(cohort2) req.db.flush() result = views.cohorts_index({}, req) assert len(result["results"]) == 2
def test_cohorts_index_with_cohorts(): req = DummyRequest(db=db.Session) cohort1 = models.FeatureCohort(name='cohort1') cohort2 = models.FeatureCohort(name='cohort2') db.Session.add(cohort1) db.Session.add(cohort2) db.Session.flush() result = views.cohorts_index({}, req) assert len(result["results"]) == 2
def test_cohorts_index_without_cohorts(pyramid_request): result = views.cohorts_index({}, pyramid_request) assert result["results"] == []
def test_cohorts_index_without_cohorts(): req = DummyRequest(db=db.Session) result = views.cohorts_index({}, req) assert result["results"] == []
def test_cohorts_index_without_cohorts(req): result = views.cohorts_index({}, req) assert result["results"] == []