def test_offer_get_all_by_project_id(is_resource_admin, app, db, session): is_resource_admin.return_value = True api.offer_create(test_offer_data, scoped_context) api.offer_create(test_offer_data_2, scoped_context) api.offer_create(test_offer_data_3, scoped_context_2) assert len(api.offer_get_all_by_project_id(scoped_context)) == 2
def test_offer_get_all_by_project_id(app, db, session): api.offer_create(test_offer_data, scoped_context) api.offer_create(test_offer_data_2, scoped_context) api.offer_create(test_offer_data_3, scoped_context_2) assert len(api.offer_get_all_by_project_id(scoped_context)) == 2
def get_all_by_project_id(cls, context): by_project_id = db.offer_get_all_by_project_id(context) return cls._from_db_object_list(by_project_id)