Merge lp:~roadmr/canonical-identity-provider/webservices-launchpad-pep352 into lp:canonical-identity-provider/release

Proposed by Daniel Manrique on 2018-05-28
Status: Merged
Approved by: Daniel Manrique on 2018-05-28
Approved revision: 1644
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: lp:~roadmr/canonical-identity-provider/webservices-launchpad-pep352
Merge into: lp:canonical-identity-provider/release
Prerequisite: lp:~roadmr/canonical-identity-provider/fix-deprecation-warnings-2
Diff against target: 98 lines (+9/-9)
6 files modified
src/api/v20/tests/test_registration.py (+2/-2)
src/identityprovider/forms.py (+2/-1)
src/identityprovider/tests/test_forms.py (+2/-2)
src/webservices/launchpad.py (+1/-2)
src/webui/forms.py (+1/-1)
src/webui/tests/test_views_registration.py (+1/-1)
To merge this branch: bzr merge lp:~roadmr/canonical-identity-provider/webservices-launchpad-pep352
Reviewer Review Type Date Requested Status
Maximiliano Bertacchini 2018-05-28 Approve on 2018-05-28
Review via email: mp+346983@code.launchpad.net

Commit message

Fix PEP352-related deprecation warnings.

Most of these are not Django-related but they pop up when using -Wd (as required by newer Djangos to show deprecation warnings at all).

Description of the change

Fix PEP352-related deprecation warnings.

Most of these are not Django-related but they pop up when using -Wd (as required by newer Djangos to show deprecation warnings at all).

To post a comment you must log in.
Maximiliano Bertacchini (maxiberta) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/api/v20/tests/test_registration.py'
--- src/api/v20/tests/test_registration.py 2018-02-09 20:56:16 +0000
+++ src/api/v20/tests/test_registration.py 2018-05-28 15:43:00 +0000
@@ -179,7 +179,7 @@
179 assert not Account.objects.exists()179 assert not Account.objects.exists()
180 e = ctx.exception180 e = ctx.exception
181 self.assertEqual(181 self.assertEqual(
182 e.message,182 str(e),
183 ('Dry run of setting username(%s) with dummy '183 ('Dry run of setting username(%s) with dummy '
184 'openid_identifier(%s) in Launchpad failed with (%s).') % (184 'openid_identifier(%s) in Launchpad failed with (%s).') % (
185 username, 'dummyID~', error_message))185 username, 'dummyID~', error_message))
@@ -206,7 +206,7 @@
206 assert Account.objects.all().count() == 0206 assert Account.objects.all().count() == 0
207 e = ctx.exception207 e = ctx.exception
208 self.assertEqual(208 self.assertEqual(
209 e.message,209 str(e),
210 ('Dry run of setting username(%s) with dummy '210 ('Dry run of setting username(%s) with dummy '
211 'openid_identifier(%s) in Launchpad failed with (%s).') % (211 'openid_identifier(%s) in Launchpad failed with (%s).') % (
212 username, 'dummyID~', error_message))212 username, 'dummyID~', error_message))
213213
=== modified file 'src/identityprovider/forms.py'
--- src/identityprovider/forms.py 2018-05-09 20:09:35 +0000
+++ src/identityprovider/forms.py 2018-05-28 15:43:00 +0000
@@ -195,7 +195,8 @@
195 raise Exception(_(195 raise Exception(_(
196 'Dry run of setting username(%s) with dummy openid_identifier'196 'Dry run of setting username(%s) with dummy openid_identifier'
197 '(%s) in Launchpad failed with (%s).') % (197 '(%s) in Launchpad failed with (%s).') % (
198 username, dummy_openid, e.message or e.msg))198 username, dummy_openid,
199 e.msg if hasattr(e, 'msg') else str(e)))
199200
200 return username201 return username
201202
202203
=== modified file 'src/identityprovider/tests/test_forms.py'
--- src/identityprovider/tests/test_forms.py 2018-05-09 20:50:02 +0000
+++ src/identityprovider/tests/test_forms.py 2018-05-28 15:43:00 +0000
@@ -351,7 +351,7 @@
351351
352 e = ctx.exception352 e = ctx.exception
353 self.assertEqual(353 self.assertEqual(
354 e.message,354 str(e),
355 ('Dry run of setting username(%s) with dummy '355 ('Dry run of setting username(%s) with dummy '
356 'openid_identifier(%s) in Launchpad failed with (%s).') % (356 'openid_identifier(%s) in Launchpad failed with (%s).') % (
357 username, 'dummyID~', error_message))357 username, 'dummyID~', error_message))
@@ -376,7 +376,7 @@
376376
377 e = ctx.exception377 e = ctx.exception
378 self.assertEqual(378 self.assertEqual(
379 e.message,379 str(e),
380 ('Dry run of setting username(%s) with dummy '380 ('Dry run of setting username(%s) with dummy '
381 'openid_identifier(%s) in Launchpad failed with (%s).') % (381 'openid_identifier(%s) in Launchpad failed with (%s).') % (
382 username, 'dummyID~', error_message))382 username, 'dummyID~', error_message))
383383
=== modified file 'src/webservices/launchpad.py'
--- src/webservices/launchpad.py 2018-03-01 11:23:13 +0000
+++ src/webservices/launchpad.py 2018-05-28 15:43:00 +0000
@@ -28,9 +28,8 @@
28class LaunchpadAPIError(Exception):28class LaunchpadAPIError(Exception):
2929
30 def __init__(self, code, message):30 def __init__(self, code, message):
31 super(LaunchpadAPIError, self).__init__()31 super(LaunchpadAPIError, self).__init__(message)
32 self.code = code32 self.code = code
33 self.message = message
3433
3534
36class NameAlreadyTaken(LaunchpadAPIError):35class NameAlreadyTaken(LaunchpadAPIError):
3736
=== modified file 'src/webui/forms.py'
--- src/webui/forms.py 2016-11-01 10:53:35 +0000
+++ src/webui/forms.py 2018-05-28 15:43:00 +0000
@@ -66,7 +66,7 @@
66 add_lp_ssh_key(self.account.openid_identifier, keytext,66 add_lp_ssh_key(self.account.openid_identifier, keytext,
67 dry_run=True)67 dry_run=True)
68 except LaunchpadAPIError as e:68 except LaunchpadAPIError as e:
69 raise forms.ValidationError(e.message)69 raise forms.ValidationError(str(e))
70 return keytext70 return keytext
7171
72 def add_key_to_launchpad(self):72 def add_key_to_launchpad(self):
7373
=== modified file 'src/webui/tests/test_views_registration.py'
--- src/webui/tests/test_views_registration.py 2018-02-14 14:05:59 +0000
+++ src/webui/tests/test_views_registration.py 2018-05-28 15:43:00 +0000
@@ -293,7 +293,7 @@
293293
294 e = ctx.exception294 e = ctx.exception
295 self.assertEqual(295 self.assertEqual(
296 e.message,296 str(e),
297 ('Dry run of setting username(%s) with dummy '297 ('Dry run of setting username(%s) with dummy '
298 'openid_identifier(%s) in Launchpad failed with (%s).') % (298 'openid_identifier(%s) in Launchpad failed with (%s).') % (
299 username, 'dummyID~', error_message))299 username, 'dummyID~', error_message))