Projet

Général

Profil

0001-tests-handle-quote-character-variation-in-django-3.2.patch

Paul Marillonnet, 20 mai 2022 09:55

Télécharger (1,7 ko)

Voir les différences:

Subject: [PATCH] tests: handle quote character variation in django 3.2 onwards
 (#65495)

 tests/test_manager_authenticators.py | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
tests/test_manager_authenticators.py
15 15
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 16

  
17 17
import pytest
18
from django import VERSION as DJ_VERSION
18 19

  
19 20
from authentic2_auth_oidc.models import OIDCProvider
20 21

  
......
61 62
    resp.form['show_condition'] = "'backoffice' in login_hint or remotre_addr == '1.2.3.4'"
62 63
    resp = resp.form.submit().follow()
63 64
    assert 'Click "Edit" to change configuration.' not in resp.text
64
    assert (
65
        "Show condition: &#39;backoffice&#39; in login_hint or remotre_addr == &#39;1.2.3.4&#39;" in resp.text
66
    )
67

  
65
    if DJ_VERSION[0] <= 2:
66
        assert (
67
            "Show condition: &#39;backoffice&#39; in login_hint or remotre_addr == &#39;1.2.3.4&#39;"
68
            in resp.text
69
        )
70
    else:
71
        # html-rendered quote characters change in django 3 onwards…
72
        assert (
73
            "Show condition: &#x27;backoffice&#x27; in login_hint or remotre_addr == &#x27;1.2.3.4&#x27;"
74
            in resp.text
75
        )
68 76
    resp = resp.click('Disable').follow()
69 77
    assert 'Authenticator has been disabled.' in resp.text
70 78

  
71
-