From 126f367e7665781eb15544331739b06a48740e76 Mon Sep 17 00:00:00 2001 From: Evarin Date: Sun, 21 Oct 2018 22:35:44 +0200 Subject: [PATCH] flake8 --- allauth_ens/management/commands/install_longterm.py | 6 +++--- allauth_ens/tests.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/allauth_ens/management/commands/install_longterm.py b/allauth_ens/management/commands/install_longterm.py index 40cc988..fdff5f1 100644 --- a/allauth_ens/management/commands/install_longterm.py +++ b/allauth_ens/management/commands/install_longterm.py @@ -43,18 +43,18 @@ class Command(BaseCommand): elif options.get('clipper_field', None): fields = options['clipper_field'].split('.') User = get_user_model() - + def get_subattr(obj, fields): # Allows to follow OneToOne relationships if len(fields) == 1: return getattr(obj, fields[0]) return get_subattr(getattr(obj, fields[0]), fields[1:]) - + accounts = {get_subattr(account, fields): account for account in User.objects.all()} else: accounts = None - + logs = install_longterm_adapter(fake, accounts) self.stdout.write("Social accounts created : %d" diff --git a/allauth_ens/tests.py b/allauth_ens/tests.py index a7afe33..1824b60 100644 --- a/allauth_ens/tests.py +++ b/allauth_ens/tests.py @@ -361,7 +361,7 @@ class LongTermClipperTests(CASTestCase): self.assertEqual(nsa1, nsa0) self.assertEqual(user1.username, "test@12") self.assertEqual(conn.extra_data['ldap']['entrance_year'], '12') - + def test_longterm_installer_from_allauth_command_socialaccounts(self): self._setup_ldap(12) with self.settings( @@ -384,7 +384,7 @@ class LongTermClipperTests(CASTestCase): output = stdout.getvalue() self.assertIn('test -> test@12', output) self.assertNotIn('bidule ->', output) - + r = self.client_cas_login(self.client, provider_id="clipper", username='test') user1 = r.context["user"] @@ -395,7 +395,7 @@ class LongTermClipperTests(CASTestCase): self.assertEqual(nsa1, nsa0) self.assertEqual(user1.username, "test@12") self.assertEqual(conn.extra_data['ldap']['entrance_year'], '12') - + def test_longterm_installer_from_djangocas(self): with self.settings( SOCIALACCOUNT_ADAPTER='allauth.socialaccount.'