def test__my_uploads__search__pages(client, faker, uploads): user = login(client, faker) study = faker.get_test_study(collaborator=user) my_uploads = [faker.get_test_upload(study=study, uploader=user, study_number="fred") for _ in range(uploads)] other = [faker.get_test_upload(study=study, uploader=user, study_number="margaret") for _ in range(100)] assert__page_navigation(client, _url(study_id=study.id, search='fred', _external=False), uploads)
def test__boilerplate__pages(client, faker, item_count): user = login(client, faker) the_fields = [faker.get_test_field() for _ in range(item_count)] assert__page_navigation(client, url_for('pages_of_fields', _external=False), item_count)
def test__my_jobs__pages(client, faker, jobs, loggedin_user): my_jobs = [ faker.get_test_owned_task(owner=loggedin_user, requestor=loggedin_user) for _ in range(jobs) ] assert__page_navigation(client, 'ui.my_jobs', {'_external': False}, jobs, form=MyJobsSearchForm())
def test__study_details__pages(client, faker, uploads): user = login(client, faker) study = faker.get_test_study(owner=user) my_uploads = [ faker.get_test_upload(study=study, uploader=user) for _ in range(uploads) ] assert__page_navigation(client, _url(study_id=study.id, _external=False), uploads)
def test__study_details__with_completed__pages(client, faker, uploads): completed = cycle([True, False]) user = login(client, faker) study = faker.get_test_study(owner=user) my_uploads = [ faker.get_test_upload(study=study, uploader=user, completed=next(completed)) for _ in range(uploads) ] assert__page_navigation( client, _url(study_id=study.id, showCompleted=True, _external=False), uploads)
def test__my_jobs__search__service__pages(client, faker, jobs, loggedin_user): service1 = faker.get_test_service(owners=[loggedin_user]) service2 = faker.get_test_service(owners=[loggedin_user]) matching = [ faker.get_test_task(service=service1, requestor=loggedin_user) for _ in range(jobs) ] unmatching = [ faker.get_test_task(service=service2, requestor=loggedin_user) for _ in range(100) ] assert__page_navigation(client, 'ui.my_jobs', { '_external': False, 'service_id': service1.id }, jobs, form=MyJobsSearchForm())
def test__my_jobs__search__name__pages(client, faker, jobs, loggedin_user): matching = [ faker.get_test_owned_task(name='Mary', owner=loggedin_user, requestor=loggedin_user) for _ in range(jobs) ] unmatching = [ faker.get_test_owned_task(name='Joseph', owner=loggedin_user, requestor=loggedin_user) for _ in range(100) ] assert__page_navigation(client, 'ui.my_jobs', { '_external': False, 'search': 'ar' }, jobs, form=MyJobsSearchForm())
def test__my_jobs__search__task_status__pages(client, faker, jobs, loggedin_user): matching = [ faker.get_test_owned_task( current_status_type=TaskStatusType.get_done(), owner=loggedin_user, requestor=loggedin_user) for _ in range(jobs) ] unmatching = [ faker.get_test_owned_task( current_status_type=TaskStatusType.get_awaiting_information(), owner=loggedin_user, requestor=loggedin_user) for _ in range(100) ] assert__page_navigation( client, 'ui.my_jobs', { '_external': False, 'task_status_type_id': TaskStatusType.get_done().id }, jobs, form=MyJobsSearchForm())