Ejemplo n.º 1
0
def test__study_no_packs__doesnt_display(client, faker):
    user = login(client, faker)

    s = faker.get_test_study(owner=user)

    resp = lbrc_identity_get(client, _url(), user)

    assert resp.status_code == 200
    assert resp.soup.find("h3", string=s.name) is None
Ejemplo n.º 2
0
def test__study_not_owner__doesnt_display(client, faker):
    user = login(client, faker)
    other_user = faker.get_test_user()

    s = faker.get_test_study(owner=other_user)
    lp = faker.get_test_label_pack(study=s)

    resp = lbrc_identity_get(client, _url(), user)

    assert resp.status_code == 200
    assert resp.soup.find("h3", string=s.name) is None
Ejemplo n.º 3
0
def test__one_pack__displays(client, faker):
    user = login(client, faker)

    s = faker.get_test_study(owner=user)
    lp = faker.get_test_label_pack(study=s)
    resp = lbrc_identity_get(client, _url(), user)

    assert resp.status_code == 200
    assert resp.soup.find("h3", string=lp.study.name) is not None

    assert__label_print_buttons(lp, resp)
Ejemplo n.º 4
0
def test__two_packs__displays(client, faker):
    user = login(client, faker)

    s = faker.get_test_study(owner=user)
    lp = faker.get_test_label_pack(study=s)
    ap = AlleviatePack(study_id=s.id)
    db.session.add(ap)

    resp = lbrc_identity_get(client, _url(), user)

    assert resp.status_code == 200
    assert resp.soup.find("h3", string=lp.study.name) is not None

    assert__label_print_buttons(lp, resp)
    assert__label_print_buttons(ap, resp)
Ejemplo n.º 5
0
def test__two_studies__displays(client, faker):
    user = login(client, faker)

    s1 = faker.get_test_study(owner=user)
    s2 = faker.get_test_study(owner=user)
    lp1 = faker.get_test_label_pack(study=s1)
    lp2 = faker.get_test_label_pack(study=s2)

    resp = lbrc_identity_get(client, _url(), user)

    assert resp.status_code == 200
    assert resp.soup.find("h3", string=lp1.study.name) is not None
    assert resp.soup.find("h3", string=lp2.study.name) is not None

    assert__label_print_buttons(lp1, resp)
    assert__label_print_buttons(lp2, resp)
def test__label_print_definition__get(client, faker):
    user = login(client, faker)
    faker.add_all_studies(user)

    pack = LabelPack.query.filter_by(type='GoDcmPack').one()

    resp = lbrc_identity_get(
        client,
        _url(
            referrer='study',
            study_id=pack.study_id,
            pack_name=pack.type,
            count=1,
        ), user)

    assert resp.status_code == 200
def test__ui_demographics_define_columns_get(client, faker):
    user = login(client, faker)
    headers = faker.column_headers(10)

    dr = do_create_request(client, faker, user, headers=headers)

    response = lbrc_identity_get(client, _url(id=dr.id), user)
    assert response.status_code == 200

    for sid in [
            'nhs_number_column_id', 'family_name_column_id',
            'given_name_column_id', 'gender_column_id', 'dob_column_id',
            'postcode_column_id'
    ]:
        select = response.soup.find('select', id=sid)
        assert select is not None

        for o in ['', *headers]:
            assert select.find('option', string=o) is not None

    _remove_files(dr)
Ejemplo n.º 8
0
def test__labels__logged_in(client, faker):
    user = login(client, faker)
    resp = lbrc_identity_get(client, _url(), user)

    assert resp.status_code == 200