Ejemplo n.º 1
0
def public_candidate_two_groups(public_filter, public_filter2, public_group,
                                public_group2):
    obj = ObjFactory(groups=[public_group, public_group2])
    DBSession.add(Candidate(obj=obj, filter=public_filter))
    DBSession.add(Candidate(obj=obj, filter=public_filter2))
    DBSession.commit()
    return obj
Ejemplo n.º 2
0
def public_candidate(public_filter, user):
    obj = ObjFactory(groups=[public_filter.group])
    candidate = Candidate(
        obj=obj,
        filter=public_filter,
        passed_at=datetime.utcnow() - timedelta(seconds=np.random.randint(0, 100)),
        uploader_id=user.id,
    )
    DBSession.add(candidate)
    DBSession.commit()
    yield obj
    ObjFactory.teardown(obj)
Ejemplo n.º 3
0
def public_candidate2(public_filter, user):
    obj = ObjFactory(groups=[public_filter.group])
    DBSession.add(
        Candidate(
            obj=obj,
            filter=public_filter,
            passed_at=datetime.utcnow() -
            timedelta(seconds=np.random.randint(0, 100)),
            uploader_id=user.id,
        ))
    DBSession.commit()
    return obj
Ejemplo n.º 4
0
def public_candidate_two_groups(public_filter, public_filter2, public_group,
                                public_group2, user):
    obj = ObjFactory(groups=[public_group, public_group2])
    candidates = []
    for filter_ in [public_filter, public_filter2]:
        candidate = Candidate(
            obj=obj,
            filter=filter_,
            passed_at=datetime.utcnow() -
            timedelta(seconds=np.random.randint(0, 100)),
            uploader_id=user.id,
        )
        candidates.append(candidate)
        DBSession.add(candidate)
    DBSession.commit()
    yield obj
    ObjFactory.teardown(obj)
Ejemplo n.º 5
0
def public_candidate2(public_filter):
    obj = ObjFactory(groups=[public_filter.group])
    DBSession.add(Candidate(obj=obj, filter=public_filter))
    DBSession.commit()
    return obj
Ejemplo n.º 6
0
def public_candidate(public_filter):
    obj = ObjFactory()
    DBSession.add(Candidate(obj=obj, filter=public_filter))
    DBSession.commit()
    return obj