Пример #1
0
def test_can_set_upc_on_version_number_match_with_empty_upc(test_client, db):
    build_catalog(test_client, db)
    in_ver = 'TEST-01lp'
    out_ver = 'TEST-01lp'
    in_upc = ''
    out_upc = db.session.query(Version).filter(
        Version.version_number == out_ver).one().upc
    add_income_pending(test_client, db, in_ver, in_upc)
    po.add_missing_upc()
    res = db.session.query(IncomePending).one()
    assert res.upc_id == out_upc
Пример #2
0
def test_can_set_upc_on_bundle_number_cases_with_empty_upc(test_client, db):
    build_catalog(test_client, db)
    in_ver_list = [
        'BUNDLE-01',
        'BUNDLE-01-',
        'bundle-01',
        'BuNdLE01',
    ]
    out_ver = 'BUNDLE-01'
    in_upc = ''
    out_upc = db.session.query(Bundle).filter(
        Bundle.bundle_number == out_ver).one().upc

    for in_ver in in_ver_list:
        add_income_pending(test_client, db, in_ver, in_upc)
        id = db.session.query(IncomePending).filter(
            IncomePending.version_number == in_ver).one().id
        po.add_missing_upc()
        res = db.session.query(IncomePending).filter(
            IncomePending.id == id).one()
        assert res.upc_id == out_upc
Пример #3
0
def test_can_set_upc_on_version_number_cases(test_client, db):
    build_catalog(test_client, db)
    in_ver_list = [
        'TEST-01-lp',
        'TEST-01-LP',
        'TEST01LP',
        'TeSt01lP',
        'test01lp',
    ]
    out_ver = 'TEST-01lp'
    in_upc = None
    out_upc = db.session.query(Version).filter(
        Version.version_number == out_ver).one().upc

    for in_ver in in_ver_list:
        add_income_pending(test_client, db, in_ver, in_upc)
        id = db.session.query(IncomePending).filter(
            IncomePending.version_number == in_ver).one().id
        po.add_missing_upc()
        res = db.session.query(IncomePending).filter(
            IncomePending.id == id).one()
        assert res.upc_id == out_upc