diff --git a/setup.py b/setup.py index c1c7bda..60c93c4 100755 --- a/setup.py +++ b/setup.py @@ -89,7 +89,7 @@ setup( description='Authentic2 Fedict plugin', author="Entr'ouvert", url='https://repos.entrouvert.org/authentic2-auth-fedict.git', - author_email="info@entrouvert.com", + author_email='info@entrouvert.com', packages=find_packages('src'), package_dir={ '': 'src', diff --git a/src/authentic2_auth_fedict/fields.py b/src/authentic2_auth_fedict/fields.py index cb0c7b6..e4827d8 100644 --- a/src/authentic2_auth_fedict/fields.py +++ b/src/authentic2_auth_fedict/fields.py @@ -137,7 +137,7 @@ class NumHouseField(forms.CharField): if not value: return try: - if not re.match("^[1-9][0-9]*$", value): + if not re.match('^[1-9][0-9]*$', value): raise ValueError() except ValueError: raise forms.ValidationError(getattr(settings, 'A2_NUMHOUSE_ERROR_MESSAGE', _('Invalid format'))) @@ -149,7 +149,7 @@ class NumPhoneField(forms.CharField): if not value: return try: - if not re.match("^(0|\\+|00)(\\d{8,})", value): + if not re.match('^(0|\\+|00)(\\d{8,})', value): raise ValueError() except ValueError: raise forms.ValidationError(getattr(settings, 'A2_NUMPHONE_ERROR_MESSAGE', _('Invalid format'))) diff --git a/tests/settings.py b/tests/settings.py index 47ebe1e..94718c1 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -19,21 +19,21 @@ if 'postgres' in DATABASES['default']['ENGINE']: LANGUAGE_CODE = 'en' A2_AUTH_SAML_ENABLE = False -MELLON_ADAPTER = ["authentic2_auth_fedict.adapters.AuthenticAdapter"] -MELLON_LOGIN_URL = "fedict-login" -MELLON_PUBLIC_KEYS = ["./tests/saml.crt"] -MELLON_PRIVATE_KEY = "./tests/saml.key" +MELLON_ADAPTER = ['authentic2_auth_fedict.adapters.AuthenticAdapter'] +MELLON_LOGIN_URL = 'fedict-login' +MELLON_PUBLIC_KEYS = ['./tests/saml.crt'] +MELLON_PRIVATE_KEY = './tests/saml.key' MELLON_IDENTITY_PROVIDERS = [ { - "METADATA": open("./tests/metadata.xml").read(), - "ENTITY_ID": "https://idp.com/", - "SLUG": "idp", + 'METADATA': open('./tests/metadata.xml').read(), + 'ENTITY_ID': 'https://idp.com/', + 'SLUG': 'idp', }, ] MELLON_ATTRIBUTE_MAPPING = { - "last_name": "{attributes[surname][0]}", - "first_name": "{attri,butes[givenName][0]}", + 'last_name': '{attributes[surname][0]}', + 'first_name': '{attri,butes[givenName][0]}', } INSTALLED_APPS += ('authentic2_auth_fedict',) diff --git a/tests/test_all.py b/tests/test_all.py index 0f29b77..6ff64d6 100644 --- a/tests/test_all.py +++ b/tests/test_all.py @@ -194,11 +194,11 @@ def test_eid_unlink(app, settings, issuer, user, authenticator): ) 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() 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): @@ -347,7 +347,7 @@ def test_fedict_authenticator_data_migration(settings): FedictAuthenticator = old_apps.get_model(app, 'FedictAuthenticator') 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