Project

General

Profile

0003-tests-add-non-regression-test-30485.patch

Benjamin Dauvergne, 26 Feb 2019 01:19 PM

Download (2.33 KB)

View differences:

Subject: [PATCH 3/4] tests: add non regression test (#30485)

 tests/test_tipi.py | 6 ++++++
 1 file changed, 6 insertions(+)
tests/test_tipi.py
17 17
        email='info@entrouvert.com',
18 18
        urlcl='http://example.com/tipi/test',
19 19
        saisie='T')
20
    assert eopayment.tipi.Payment.REFDET_RE.match(payment_id) is not None
20 21
    parsed_qs = parse_qs(urlparse(url).query)
21 22
    assert parsed_qs['objet'][0].startswith('tout a fait')
22 23
    assert parsed_qs['montant'] == ['12312']
......
36 37
        p.response('foo=bar')
37 38

  
38 39

  
40
@pytest.mark.xfail
39 41
def test_tipi_no_orderid_no_refdet():
40 42
    p = eopayment.Payment('tipi', {'numcli': '12345'})
41 43
    payment_id, kind, url = p.request(
......
43 45
        exer=9999,
44 46
        email='info@entrouvert.com',
45 47
        saisie='T')
48
    assert eopayment.tipi.Payment.REFDET_RE.match(payment_id) is not None
46 49
    parsed_qs = parse_qs(urlparse(url).query)
47 50
    assert 'objet' not in parsed_qs
48 51
    assert parsed_qs['montant'] == ['12312']
......
59 62
        amount=Decimal('123.12'),
60 63
        email='info@entrouvert.com',
61 64
        orderid='F121212')
65
    assert eopayment.tipi.Payment.REFDET_RE.match(payment_id)
62 66
    expected_url = urlparse(eopayment.tipi.TIPI_URL)
63 67
    parsed_url = urlparse(url)
64 68
    assert parsed_url[:3] == expected_url[:3]
......
72 76
    assert parsed_qs['refdet'] == ['F121212']
73 77

  
74 78

  
79
@pytest.mark.xfail
75 80
def test_tipi_orderid_not_refdef_compatible():
76 81
    p = eopayment.Payment('tipi', {'numcli': '12345', 'saisie': 'A'})
77 82
    payment_id, kind, url = p.request(
......
79 84
        email='info@entrouvert.com',
80 85
        objet='coucou',
81 86
        orderid='F12-12-12')
87
    assert eopayment.tipi.Payment.REFDET_RE.match(payment_id) is not None
82 88
    expected_url = urlparse(eopayment.tipi.TIPI_URL)
83 89
    parsed_url = urlparse(url)
84 90
    assert parsed_url[:3] == expected_url[:3]
85
-