misc: apply double-quote-string-fixer (#79788)
This commit is contained in:
parent
8a0ccd8303
commit
cc93edc608
2
setup.py
2
setup.py
|
@ -89,7 +89,7 @@ setup(
|
||||||
description='Authentic2 Fedict plugin',
|
description='Authentic2 Fedict plugin',
|
||||||
author="Entr'ouvert",
|
author="Entr'ouvert",
|
||||||
url='https://repos.entrouvert.org/authentic2-auth-fedict.git',
|
url='https://repos.entrouvert.org/authentic2-auth-fedict.git',
|
||||||
author_email="info@entrouvert.com",
|
author_email='info@entrouvert.com',
|
||||||
packages=find_packages('src'),
|
packages=find_packages('src'),
|
||||||
package_dir={
|
package_dir={
|
||||||
'': 'src',
|
'': 'src',
|
||||||
|
|
|
@ -137,7 +137,7 @@ class NumHouseField(forms.CharField):
|
||||||
if not value:
|
if not value:
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
if not re.match("^[1-9][0-9]*$", value):
|
if not re.match('^[1-9][0-9]*$', value):
|
||||||
raise ValueError()
|
raise ValueError()
|
||||||
except ValueError:
|
except ValueError:
|
||||||
raise forms.ValidationError(getattr(settings, 'A2_NUMHOUSE_ERROR_MESSAGE', _('Invalid format')))
|
raise forms.ValidationError(getattr(settings, 'A2_NUMHOUSE_ERROR_MESSAGE', _('Invalid format')))
|
||||||
|
@ -149,7 +149,7 @@ class NumPhoneField(forms.CharField):
|
||||||
if not value:
|
if not value:
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
if not re.match("^(0|\\+|00)(\\d{8,})", value):
|
if not re.match('^(0|\\+|00)(\\d{8,})', value):
|
||||||
raise ValueError()
|
raise ValueError()
|
||||||
except ValueError:
|
except ValueError:
|
||||||
raise forms.ValidationError(getattr(settings, 'A2_NUMPHONE_ERROR_MESSAGE', _('Invalid format')))
|
raise forms.ValidationError(getattr(settings, 'A2_NUMPHONE_ERROR_MESSAGE', _('Invalid format')))
|
||||||
|
|
|
@ -19,21 +19,21 @@ if 'postgres' in DATABASES['default']['ENGINE']:
|
||||||
LANGUAGE_CODE = 'en'
|
LANGUAGE_CODE = 'en'
|
||||||
A2_AUTH_SAML_ENABLE = False
|
A2_AUTH_SAML_ENABLE = False
|
||||||
|
|
||||||
MELLON_ADAPTER = ["authentic2_auth_fedict.adapters.AuthenticAdapter"]
|
MELLON_ADAPTER = ['authentic2_auth_fedict.adapters.AuthenticAdapter']
|
||||||
MELLON_LOGIN_URL = "fedict-login"
|
MELLON_LOGIN_URL = 'fedict-login'
|
||||||
MELLON_PUBLIC_KEYS = ["./tests/saml.crt"]
|
MELLON_PUBLIC_KEYS = ['./tests/saml.crt']
|
||||||
MELLON_PRIVATE_KEY = "./tests/saml.key"
|
MELLON_PRIVATE_KEY = './tests/saml.key'
|
||||||
MELLON_IDENTITY_PROVIDERS = [
|
MELLON_IDENTITY_PROVIDERS = [
|
||||||
{
|
{
|
||||||
"METADATA": open("./tests/metadata.xml").read(),
|
'METADATA': open('./tests/metadata.xml').read(),
|
||||||
"ENTITY_ID": "https://idp.com/",
|
'ENTITY_ID': 'https://idp.com/',
|
||||||
"SLUG": "idp",
|
'SLUG': 'idp',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
MELLON_ATTRIBUTE_MAPPING = {
|
MELLON_ATTRIBUTE_MAPPING = {
|
||||||
"last_name": "{attributes[surname][0]}",
|
'last_name': '{attributes[surname][0]}',
|
||||||
"first_name": "{attri,butes[givenName][0]}",
|
'first_name': '{attri,butes[givenName][0]}',
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTALLED_APPS += ('authentic2_auth_fedict',)
|
INSTALLED_APPS += ('authentic2_auth_fedict',)
|
||||||
|
|
|
@ -194,11 +194,11 @@ def test_eid_unlink(app, settings, issuer, user, authenticator):
|
||||||
)
|
)
|
||||||
|
|
||||||
response = login(app, user, path='/accounts/', password=user.username)
|
response = login(app, user, path='/accounts/', password=user.username)
|
||||||
assert "Unlink my account" in response.text
|
assert 'Unlink my account' in response.text
|
||||||
app.get('/accounts/fedict/unlink/').follow()
|
app.get('/accounts/fedict/unlink/').follow()
|
||||||
|
|
||||||
response = app.get('/accounts/')
|
response = app.get('/accounts/')
|
||||||
assert "Link my account to my eID card" in response.text
|
assert 'Link my account to my eID card' in response.text
|
||||||
|
|
||||||
|
|
||||||
def test_provision_new_attributes_verified(app, settings, issuer, user):
|
def test_provision_new_attributes_verified(app, settings, issuer, user):
|
||||||
|
@ -347,7 +347,7 @@ def test_fedict_authenticator_data_migration(settings):
|
||||||
FedictAuthenticator = old_apps.get_model(app, 'FedictAuthenticator')
|
FedictAuthenticator = old_apps.get_model(app, 'FedictAuthenticator')
|
||||||
|
|
||||||
settings.AUTH_FRONTENDS_KWARGS = {
|
settings.AUTH_FRONTENDS_KWARGS = {
|
||||||
"fedict": {"priority": 3, "show_condition": "'backoffice' not in login_hint"}
|
'fedict': {'priority': 3, 'show_condition': "'backoffice' not in login_hint"}
|
||||||
}
|
}
|
||||||
settings.A2_AUTH_FEDICT_ENABLE = True
|
settings.A2_AUTH_FEDICT_ENABLE = True
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue