0001-tests-handle-quote-character-variation-in-django-3.2.patch
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: 'backoffice' in login_hint or remotre_addr == '1.2.3.4'" in resp.text |
|
66 |
) |
|
67 | ||
65 |
if DJ_VERSION[0] <= 2: |
|
66 |
assert ( |
|
67 |
"Show condition: 'backoffice' in login_hint or remotre_addr == '1.2.3.4'" |
|
68 |
in resp.text |
|
69 |
) |
|
70 |
else: |
|
71 |
# html-rendered quote characters change in django 3 onwards… |
|
72 |
assert ( |
|
73 |
"Show condition: 'backoffice' in login_hint or remotre_addr == '1.2.3.4'" |
|
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 |
- |