Merge lp:~canonical-isd-hackers/canonical-identity-provider/flakes into lp:canonical-identity-provider/release

Proposed by David Owen
Status: Merged
Approved by: David Owen
Approved revision: no longer in the source branch.
Merged at revision: 252
Proposed branch: lp:~canonical-isd-hackers/canonical-identity-provider/flakes
Merge into: lp:canonical-identity-provider/release
Prerequisite: lp:~canonical-isd-hackers/canonical-identity-provider/deprecated-auth
Diff against target: 378 lines (+30/-54)
21 files modified
identityprovider/api10/handlers.py (+1/-2)
identityprovider/const.py (+0/-2)
identityprovider/decorators.py (+1/-1)
identityprovider/management/commands/populate.py (+1/-2)
identityprovider/management/commands/runserver_plus.py (+0/-2)
identityprovider/models/account.py (+0/-2)
identityprovider/models/authtoken.py (+1/-1)
identityprovider/readonly.py (+6/-7)
identityprovider/tests/test_backend_base.py (+1/-1)
identityprovider/tests/test_dbfailover.py (+3/-3)
identityprovider/tests/test_models_api.py (+0/-3)
identityprovider/tests/test_models_person.py (+3/-5)
identityprovider/tests/test_views_account.py (+2/-2)
identityprovider/tests/test_views_consumer.py (+3/-5)
identityprovider/tests/test_views_saml2.py (+1/-5)
identityprovider/tests/test_views_server.py (+2/-2)
identityprovider/tests/test_views_utils.py (+2/-5)
identityprovider/views/account.py (+1/-1)
identityprovider/views/readonly.py (+1/-1)
identityprovider/views/saml2.py (+0/-1)
identityprovider/views/ui.py (+1/-1)
To merge this branch: bzr merge lp:~canonical-isd-hackers/canonical-identity-provider/flakes
Reviewer Review Type Date Requested Status
Canonical ISD hackers Pending
Review via email: mp+86436@code.launchpad.net

Commit message

flake'd

To post a comment you must log in.
Revision history for this message
ISD Branch Mangler (isd-branches-mangler) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'identityprovider/api10/handlers.py'
2--- identityprovider/api10/handlers.py 2011-11-29 15:51:53 +0000
3+++ identityprovider/api10/handlers.py 2011-12-20 17:34:26 +0000
4@@ -1,7 +1,6 @@
5 # Copyright 2010 Canonical Ltd. This software is licensed under the
6 # GNU Affero General Public License version 3 (see the file LICENSE).
7 import logging
8-import sys
9
10 from django.conf import settings
11 from django.core.serializers.json import DateTimeAwareJSONEncoder
12@@ -178,7 +177,7 @@
13 for (k, v) in form.errors.items())
14 result = {'status': 'error', 'errors': errors}
15 return result
16- except VerifyCaptchaError, e:
17+ except VerifyCaptchaError:
18 logging.exception("reCaptcha connection error")
19 return {'status': 'error', 'errors':
20 {'captcha_solution': [
21
22=== modified file 'identityprovider/const.py'
23--- identityprovider/const.py 2011-07-25 19:00:11 +0000
24+++ identityprovider/const.py 2011-12-20 17:34:26 +0000
25@@ -1,8 +1,6 @@
26 # Copyright 2010 Canonical Ltd. This software is licensed under the
27 # GNU Affero General Public License version 3 (see the file LICENSE).
28
29-import datetime
30-
31 LAUNCHPAD_TEAMS_NS = 'http://ns.launchpad.net/2007/openid-teams'
32
33 PERSON_VISIBILITY_PUBLIC = 1
34
35=== modified file 'identityprovider/decorators.py'
36--- identityprovider/decorators.py 2011-12-15 16:29:12 +0000
37+++ identityprovider/decorators.py 2011-12-20 17:34:26 +0000
38@@ -4,7 +4,7 @@
39 import logging
40
41 from django.template import RequestContext
42-from django.http import HttpResponseRedirect, HttpResponseForbidden
43+from django.http import Http404, HttpResponseRedirect, HttpResponseForbidden
44 from django.core.cache import cache
45 from django.conf import settings
46 from django.template.loader import render_to_string
47
48=== modified file 'identityprovider/management/commands/populate.py'
49--- identityprovider/management/commands/populate.py 2011-01-24 18:28:09 +0000
50+++ identityprovider/management/commands/populate.py 2011-12-20 17:34:26 +0000
51@@ -1,5 +1,5 @@
52 from os import urandom
53-from random import choice, randint
54+from random import randint
55 from string import lowercase
56 from time import time
57
58@@ -11,7 +11,6 @@
59 from datetime import datetime
60
61 from identityprovider.utils import encrypt_launchpad_password
62-from identityprovider.models import Account
63 from identityprovider.models.const import (AccountCreationRationale,
64 AccountStatus, EmailStatus)
65
66
67=== modified file 'identityprovider/management/commands/runserver_plus.py'
68--- identityprovider/management/commands/runserver_plus.py 2010-09-08 19:53:42 +0000
69+++ identityprovider/management/commands/runserver_plus.py 2011-12-20 17:34:26 +0000
70@@ -1,7 +1,5 @@
71 from django.core.management.base import BaseCommand, CommandError
72 from optparse import make_option
73-import os
74-import sys
75
76
77 def null_technical_500_response(request, exc_type, exc_value, tb):
78
79=== modified file 'identityprovider/models/account.py'
80--- identityprovider/models/account.py 2011-12-19 16:18:51 +0000
81+++ identityprovider/models/account.py 2011-12-20 17:34:26 +0000
82@@ -131,8 +131,6 @@
83 return sites.order_by('-date_last_used')
84
85 def _get_preferredemail(self):
86- # import here to avoid circular dependancy issue
87- from identityprovider.models.emailaddress import EmailAddress
88 if not hasattr(self, '_preferredemail'):
89 try:
90 email = None
91
92=== modified file 'identityprovider/models/authtoken.py'
93--- identityprovider/models/authtoken.py 2011-12-05 15:17:22 +0000
94+++ identityprovider/models/authtoken.py 2011-12-20 17:34:26 +0000
95@@ -218,7 +218,7 @@
96 while obj.objects.get(**params) is not None:
97 token = create_token(token_length)
98 params = {column: token}
99- except Exception, e:
100+ except Exception:
101 pass
102 return token
103
104
105=== modified file 'identityprovider/readonly.py'
106--- identityprovider/readonly.py 2011-02-10 20:04:09 +0000
107+++ identityprovider/readonly.py 2011-12-20 17:34:26 +0000
108@@ -2,9 +2,9 @@
109 # GNU Affero General Public License version 3 (see the file LICENSE).
110
111 import os
112-import sys
113+import stat
114 from time import time
115-import stat
116+
117 from django.conf import settings
118 from django.db import connection
119 from django.utils import simplejson
120@@ -207,10 +207,9 @@
121 cursor = connection.cursor()
122 cursor.execute('SELECT 42')
123 result = True
124- except Exception, e:
125- # Just catch all exceptions here because the
126- # DB-API doesn't define a standard set of exceptions
127- # to catch, so we'd need to start catching
128- # engine-specific stuff.
129+ except Exception:
130+ # Just catch all exceptions here because the DB-API
131+ # doesn't define a standard set of exceptions to catch, so
132+ # we'd need to start catching engine-specific stuff.
133 pass
134 return result
135
136=== modified file 'identityprovider/tests/test_backend_base.py'
137--- identityprovider/tests/test_backend_base.py 2011-07-27 19:20:16 +0000
138+++ identityprovider/tests/test_backend_base.py 2011-12-20 17:34:26 +0000
139@@ -211,7 +211,7 @@
140 # pg_sleep's argument is seconds
141 self.assertRaises(DatabaseError,
142 cursor.execute, 'SELECT pg_sleep(1)')
143- except Exception, e:
144+ except Exception:
145 pass
146 finally:
147 cursor.connection.close()
148
149=== modified file 'identityprovider/tests/test_dbfailover.py'
150--- identityprovider/tests/test_dbfailover.py 2011-07-22 14:27:09 +0000
151+++ identityprovider/tests/test_dbfailover.py 2011-12-20 17:34:26 +0000
152@@ -81,7 +81,7 @@
153 self.backup('DBFAILOVER_ATTEMPTS')
154 settings.DBFAILOVER_ATTEMPTS = 3
155 mockdb.fail_next_N_connections(2)
156- response = self.client.get('/')
157+ self.client.get('/')
158
159 def test_master_fail(self):
160 """Check that we switch to readonly when the master fails."""
161@@ -90,7 +90,7 @@
162 settings.DBFAILOVER_ATTEMPTS = 3
163 settings.DB_CONNECTIONS = test_db_connections
164 mockdb.fail_next_N_connections(4)
165- response = self.client.get('/')
166+ self.client.get('/')
167 self.assert_(settings.READ_ONLY_MODE)
168 self.assertEquals('testslave', settings.DATABASE_ID)
169 self.rm.clear_readonly()
170@@ -121,7 +121,7 @@
171 settings.DB_CONNECTIONS = test_db_connections
172 settings.DBFAILOVER_ATTEMPTS = 3
173 mockdb.fail_next_N_connections(4)
174- response = self.client.get('/')
175+ self.client.get('/')
176 flags = os.listdir(flagdir)
177 self.assert_(len(flags) == 2)
178 finally:
179
180=== modified file 'identityprovider/tests/test_models_api.py'
181--- identityprovider/tests/test_models_api.py 2011-07-15 11:50:53 +0000
182+++ identityprovider/tests/test_models_api.py 2011-12-20 17:34:26 +0000
183@@ -1,9 +1,6 @@
184 # Copyright 2010 Canonical Ltd. This software is licensed under the
185 # GNU Affero General Public License version 3 (see the file LICENSE).
186-from django.test import TestCase
187
188-from identityprovider.models.emailaddress import EmailAddress
189-from identityprovider.models.const import EmailStatus
190 from identityprovider.models.api import APIUser
191 from identityprovider.utils import encrypt_launchpad_password, generate_salt
192
193
194=== modified file 'identityprovider/tests/test_models_person.py'
195--- identityprovider/tests/test_models_person.py 2011-07-27 14:45:35 +0000
196+++ identityprovider/tests/test_models_person.py 2011-12-20 17:34:26 +0000
197@@ -28,20 +28,18 @@
198 self.assertFalse(self.person1.in_team('no-team'))
199
200 def test_in_team(self):
201- tp = TeamParticipation.objects.create(team=self.team1,
202- person=self.person1)
203+ TeamParticipation.objects.create(team=self.team1, person=self.person1)
204 self.assertTrue(self.person1.in_team('team'))
205
206 def test_in_team_object(self):
207- tp = TeamParticipation.objects.create(team=self.team1,
208- person=self.person1)
209+ TeamParticipation.objects.create(team=self.team1, person=self.person1)
210 self.assertTrue(self.person1.in_team(self.team1))
211
212 def test_not_in_team(self):
213 self.assertFalse(self.person1.in_team('team'))
214
215 def test_in_team_no_teamparticipation_same_owner(self):
216- team = Person.objects.create(name='otherteam', teamowner=self.person1)
217+ Person.objects.create(name='otherteam', teamowner=self.person1)
218 self.assertTrue(self.person1.in_team('otherteam'))
219
220 def test_account_when_no_account(self):
221
222=== modified file 'identityprovider/tests/test_views_account.py'
223--- identityprovider/tests/test_views_account.py 2011-12-16 11:09:45 +0000
224+++ identityprovider/tests/test_views_account.py 2011-12-20 17:34:26 +0000
225@@ -101,8 +101,8 @@
226 mail.outbox = []
227
228 def test_new_email_post_with_token(self):
229- r = self.client.post('/thisissuperrando/+new-email',
230- {'newemail': "very-new-email@example.com"})
231+ self.client.post('/thisissuperrando/+new-email',
232+ {'newemail': "very-new-email@example.com"})
233 self.assertEqual(len(mail.outbox), 1)
234 mail.outbox = []
235
236
237=== modified file 'identityprovider/tests/test_views_consumer.py'
238--- identityprovider/tests/test_views_consumer.py 2011-07-15 11:50:53 +0000
239+++ identityprovider/tests/test_views_consumer.py 2011-12-20 17:34:26 +0000
240@@ -8,7 +8,6 @@
241 from openid.consumer import consumer
242 from openid.consumer.discover import OpenIDServiceEndpoint, OPENID_2_0_TYPE
243 from openid.message import (OPENID1_URL_LIMIT, IDENTIFIER_SELECT)
244-from openid.store.filestore import FileOpenIDStore
245 from openid.yadis.constants import YADIS_CONTENT_TYPE
246 from urllib import quote_plus
247
248@@ -25,9 +24,8 @@
249 fetchers.Urllib2Fetcher = MockFetcher
250 from identityprovider.tests.utils import SSOBaseTestCase
251 from identityprovider.views import server
252-from identityprovider.views.consumer import (SREG_DONT_REQUEST, SREG_OPTIONAL,
253- SREG_REQUIRED, getBaseURL, normalDict, getOpenIDStore, getConsumer,
254- getViewURL, renderIndexPage, startOpenID, finishOpenID, rpXRDS)
255+from identityprovider.views.consumer import (SREG_OPTIONAL,
256+ SREG_REQUIRED, getBaseURL, normalDict, renderIndexPage, startOpenID)
257
258
259 class DummyRequest(object):
260@@ -50,7 +48,7 @@
261
262 class FetcherTestCase(unittest.TestCase):
263 def test_check_custom_fetcher_called(self):
264- response = startOpenID(DummyDjangoRequest())
265+ startOpenID(DummyDjangoRequest())
266 self.assertTrue(MockFetcher.called)
267
268
269
270=== modified file 'identityprovider/tests/test_views_saml2.py'
271--- identityprovider/tests/test_views_saml2.py 2011-10-12 19:53:50 +0000
272+++ identityprovider/tests/test_views_saml2.py 2011-12-20 17:34:26 +0000
273@@ -6,13 +6,9 @@
274 import base64
275
276 from BeautifulSoup import BeautifulSoup
277-from django.http import HttpResponseRedirect
278 from django.conf import settings
279-from django.contrib.auth.models import User
280-from django.test import TestCase
281-from django.test.client import Client
282 from nose.tools import nottest
283-from saml2idp import codex, exceptions, saml2idp_settings
284+from saml2idp import saml2idp_settings
285 from saml2idp.tests import salesforce, google_apps
286
287 from identityprovider import tests as TEST_PACKAGE # for find_cert_path()
288
289=== modified file 'identityprovider/tests/test_views_server.py'
290--- identityprovider/tests/test_views_server.py 2011-09-19 19:18:51 +0000
291+++ identityprovider/tests/test_views_server.py 2011-12-20 17:34:26 +0000
292@@ -267,11 +267,11 @@
293 self.assertEqual('en', self.client.session['django_language'])
294
295 def test_language_persists_in_session(self):
296- response = self.client.get('/de/+openid')
297+ self.client.get('/de/+openid')
298 self.assertEqual('de', self.client.session['django_language'])
299 # Requesting a second time will still bring back German
300 # if no other setting takes precedence (like the user's preference)
301- response = self.client.get('/+openid')
302+ self.client.get('/+openid')
303 self.assertEqual('de', self.client.session['django_language'])
304
305
306
307=== modified file 'identityprovider/tests/test_views_utils.py'
308--- identityprovider/tests/test_views_utils.py 2011-07-15 14:47:15 +0000
309+++ identityprovider/tests/test_views_utils.py 2011-12-20 17:34:26 +0000
310@@ -43,15 +43,12 @@
311 self.assertEqual(rpconfig, expected_rpconfig)
312
313 def test_get_rpconfig_partial_match_longer(self):
314- expected_rpconfig = OpenIDRPConfig.objects.create(
315- trust_root=self.trust_root1)
316-
317+ OpenIDRPConfig.objects.create(trust_root=self.trust_root1)
318 rpconfig = utils.get_rpconfig(self.trust_root1 + 'some/extra/url/')
319 self.assertEqual(rpconfig, None)
320
321 def test_get_rpconfig_partial_match_shorter(self):
322- expected_rpconfig = OpenIDRPConfig.objects.create(
323+ OpenIDRPConfig.objects.create(
324 trust_root=self.trust_root1 + 'some/extra/url/')
325-
326 rpconfig = utils.get_rpconfig(self.trust_root1)
327 self.assertEqual(rpconfig, None)
328
329=== modified file 'identityprovider/views/account.py'
330--- identityprovider/views/account.py 2011-12-16 11:20:21 +0000
331+++ identityprovider/views/account.py 2011-12-20 17:34:26 +0000
332@@ -107,7 +107,7 @@
333 def account_deactivate(request, token=None):
334 request.token = token
335 import django.contrib.auth as auth
336- from identityprovider.models.const import AccountStatus, EmailStatus
337+ from identityprovider.models.const import AccountStatus
338
339 account = request.user
340 for email in account.emailaddress_set.all():
341
342=== modified file 'identityprovider/views/readonly.py'
343--- identityprovider/views/readonly.py 2011-07-27 19:20:16 +0000
344+++ identityprovider/views/readonly.py 2011-12-20 17:34:26 +0000
345@@ -121,7 +121,7 @@
346 post = [('action', action),
347 ('conn', conn),
348 ]
349- datastr = _remote_req(post=post, **server)
350+ _remote_req(post=post, **server)
351
352 @csrf_exempt
353 def readonly_data(request):
354
355=== modified file 'identityprovider/views/saml2.py'
356--- identityprovider/views/saml2.py 2011-10-07 19:32:29 +0000
357+++ identityprovider/views/saml2.py 2011-12-20 17:34:26 +0000
358@@ -1,7 +1,6 @@
359 # Copyright 2011 Canonical Ltd. This software is licensed under the
360 # GNU Affero General Public License version 3 (see the file LICENSE).
361
362-from django.conf import settings
363 from saml2idp import exceptions, google_apps, salesforce
364
365 from ..auth import internal_authorize
366
367=== modified file 'identityprovider/views/ui.py'
368--- identityprovider/views/ui.py 2011-12-16 12:28:48 +0000
369+++ identityprovider/views/ui.py 2011-12-20 17:34:26 +0000
370@@ -490,7 +490,7 @@
371 verified = captcha.verify(captcha_solution, ip_addr, email)
372 if verified:
373 return None
374- except VerifyCaptchaError, e:
375+ except VerifyCaptchaError:
376 logging.exception("reCaptcha connection error")
377
378 # not verified