Merge ~jugmac00/launchpad:update-webservice-api-for-iperson.createppa into launchpad:master

Proposed by Jürgen Gmach
Status: Merged
Approved by: Jürgen Gmach
Approved revision: 8770cbe1d0505fa012a4b29bc04cc6f084b187b8
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~jugmac00/launchpad:update-webservice-api-for-iperson.createppa
Merge into: launchpad:master
Diff against target: 52 lines (+19/-1)
2 files modified
lib/lp/registry/interfaces/person.py (+1/-1)
lib/lp/soyuz/tests/test_person_createppa.py (+18/-0)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+409991@code.launchpad.net

Commit message

Update webservice API for IPerson.createPPA

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

Looks great, thanks. Could you just link this to the relevant bug before landing it?

review: Approve
Revision history for this message
Jürgen Gmach (jugmac00) wrote :

> Looks great, thanks. Could you just link this to the relevant bug before
> landing it?

Thanks for the review!

I just searched on Launchpad and https://bugs.launchpad.net/launchpad/+bug/868047 should be the relevant bug for it.

I also included a reference to the bug on Launchpad in the Jira issue.

Revision history for this message
Colin Watson (cjwatson) wrote :

Ah, I hadn't realized it wasn't already linked from Jira. LGTM, thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/registry/interfaces/person.py b/lib/lp/registry/interfaces/person.py
2index febfb57..3610054 100644
3--- a/lib/lp/registry/interfaces/person.py
4+++ b/lib/lp/registry/interfaces/person.py
5@@ -1742,7 +1742,7 @@ class IPersonEditRestricted(Interface):
6 distribution=Reference(schema=Interface, required=False),
7 name=TextLine(required=True, constraint=name_validator),
8 displayname=TextLine(required=False),
9- description=TextLine(required=False),
10+ description=Text(required=False),
11 private=Bool(required=False),
12 suppress_subscription_notifications=Bool(required=False),
13 )
14diff --git a/lib/lp/soyuz/tests/test_person_createppa.py b/lib/lp/soyuz/tests/test_person_createppa.py
15index d3d9aff..cc0a00b 100644
16--- a/lib/lp/soyuz/tests/test_person_createppa.py
17+++ b/lib/lp/soyuz/tests/test_person_createppa.py
18@@ -11,12 +11,15 @@ from lp.registry.enums import (
19 )
20 from lp.registry.errors import PPACreationError
21 from lp.registry.interfaces.teammembership import TeamMembershipStatus
22+from lp.services.webapp.interfaces import OAuthPermission
23 from lp.testing import (
24+ api_url,
25 celebrity_logged_in,
26 person_logged_in,
27 TestCaseWithFactory,
28 )
29 from lp.testing.layers import DatabaseFunctionalLayer
30+from lp.testing.pages import webservice_for_person
31
32
33 class TestCreatePPA(TestCaseWithFactory):
34@@ -68,3 +71,18 @@ class TestCreatePPA(TestCaseWithFactory):
35 ppa = private_team.createPPA(private=True)
36 self.assertEqual(True, ppa.private)
37 self.assertEqual(20480, ppa.authorized_size)
38+
39+ def test_webservice_accepts_multiline_description(self):
40+ user = self.factory.makePerson()
41+ endpoint = api_url(user)
42+ webservice = webservice_for_person(
43+ user,
44+ permission=OAuthPermission.WRITE_PUBLIC,
45+ default_api_version='devel'
46+ )
47+
48+ response = webservice.named_post(
49+ endpoint, 'createPPA', description='a\nb'
50+ )
51+
52+ self.assertEqual(201, response.status)

Subscribers

People subscribed via source and target branches

to status/vote changes: