Merge lp:~leonardr/launchpad/temporary-integration into lp:launchpad/db-devel

Proposed by Leonard Richardson
Status: Merged
Merged at revision: 9918
Proposed branch: lp:~leonardr/launchpad/temporary-integration
Merge into: lp:launchpad/db-devel
Prerequisite: lp:~leonardr/launchpad/oauth-doctest-to-unit-test
Diff against target: 9423 lines (+1894/-1015)
400 files modified
buildout-templates/bin/kill-test-services.in (+1/-3)
lib/canonical/database/ftests/test_multitablecopy.txt (+1/-1)
lib/canonical/launchpad/browser/ftests/logintoken-corner-cases.txt (+3/-3)
lib/canonical/launchpad/browser/oauth.py (+96/-21)
lib/canonical/launchpad/components/tests/decoratedresultset.txt (+1/-1)
lib/canonical/launchpad/doc/account.txt (+5/-3)
lib/canonical/launchpad/doc/announcement-date-widget.txt (+1/-1)
lib/canonical/launchpad/doc/batch_navigation.txt (+1/-1)
lib/canonical/launchpad/doc/canonical_url.txt (+1/-1)
lib/canonical/launchpad/doc/canonical_url_examples.txt (+8/-5)
lib/canonical/launchpad/doc/checkbox-matrix-widget.txt (+5/-2)
lib/canonical/launchpad/doc/emailauthentication.txt (+1/-1)
lib/canonical/launchpad/doc/feeds.txt (+1/-1)
lib/canonical/launchpad/doc/gpg-encryption.txt (+1/-1)
lib/canonical/launchpad/doc/gpghandler.txt (+4/-2)
lib/canonical/launchpad/doc/hasowner-authorization.txt (+2/-2)
lib/canonical/launchpad/doc/hierarchical-menu.txt (+3/-3)
lib/canonical/launchpad/doc/launchpad-container.txt (+2/-2)
lib/canonical/launchpad/doc/launchpad-target-widget.txt (+3/-3)
lib/canonical/launchpad/doc/launchpadform.txt (+2/-2)
lib/canonical/launchpad/doc/lazr-js-widgets.txt (+1/-1)
lib/canonical/launchpad/doc/librarian.txt (+4/-4)
lib/canonical/launchpad/doc/location-widget.txt (+1/-1)
lib/canonical/launchpad/doc/logintoken-pages.txt (+1/-1)
lib/canonical/launchpad/doc/logintoken.txt (+3/-3)
lib/canonical/launchpad/doc/looptuner.txt (+1/-1)
lib/canonical/launchpad/doc/lower-case-text-widget.txt (+2/-2)
lib/canonical/launchpad/doc/menus.txt (+3/-3)
lib/canonical/launchpad/doc/message.txt (+3/-2)
lib/canonical/launchpad/doc/navigation.txt (+1/-1)
lib/canonical/launchpad/doc/new-line-to-spaces-widget.txt (+1/-1)
lib/canonical/launchpad/doc/notification-recipient-set.txt (+1/-1)
lib/canonical/launchpad/doc/notification-text-escape.txt (+1/-1)
lib/canonical/launchpad/doc/oauth-pages.txt (+27/-5)
lib/canonical/launchpad/doc/oauth.txt (+5/-0)
lib/canonical/launchpad/doc/object-privacy.txt (+3/-2)
lib/canonical/launchpad/doc/package-relationship.txt (+1/-1)
lib/canonical/launchpad/doc/presenting-lengths-of-time.txt (+1/-1)
lib/canonical/launchpad/doc/project-scope-widget.txt (+2/-2)
lib/canonical/launchpad/doc/security-proxies.txt (+2/-2)
lib/canonical/launchpad/doc/signedmessage.txt (+2/-2)
lib/canonical/launchpad/doc/sqlobject-security-proxies.txt (+2/-2)
lib/canonical/launchpad/doc/storm.txt (+11/-4)
lib/canonical/launchpad/doc/stripped-text-widget.txt (+1/-1)
lib/canonical/launchpad/doc/textsearching.txt (+2/-2)
lib/canonical/launchpad/doc/timeout.txt (+3/-3)
lib/canonical/launchpad/doc/tokens-text-widget.txt (+1/-1)
lib/canonical/launchpad/doc/validation.txt (+7/-6)
lib/canonical/launchpad/doc/vocabularies.txt (+6/-4)
lib/canonical/launchpad/doc/webapp-authorization.txt (+2/-2)
lib/canonical/launchpad/doc/webapp-publication.txt (+5/-5)
lib/canonical/launchpad/doc/webservice-configuration.txt (+1/-1)
lib/canonical/launchpad/doc/webservice-marshallers.txt (+6/-4)
lib/canonical/launchpad/doc/xmlrpc-authserver.txt (+4/-2)
lib/canonical/launchpad/interfaces/ftests/validation.txt (+5/-4)
lib/canonical/launchpad/pagetests/feeds/xx-links.txt (+5/-2)
lib/canonical/launchpad/pagetests/oauth/access-token.txt (+4/-3)
lib/canonical/launchpad/pagetests/oauth/authorize-token.txt (+168/-29)
lib/canonical/launchpad/pagetests/oauth/managing-tokens.txt (+3/-2)
lib/canonical/launchpad/pagetests/standalone/xx-opstats.txt (+1/-1)
lib/canonical/launchpad/pagetests/standalone/xx-request-expired.txt (+1/-1)
lib/canonical/launchpad/pagetests/standalone/xx-soft-timeout.txt (+1/-1)
lib/canonical/launchpad/pagetests/webservice/xx-service.txt (+1/-1)
lib/canonical/launchpad/pagetests/webservice/xx-wadl.txt (+1/-1)
lib/canonical/launchpad/templates/oauth-authorize.pt (+49/-29)
lib/canonical/launchpad/templates/token-authorized.pt (+60/-14)
lib/canonical/launchpad/webapp/ftests/test_adapter_timeout.txt.disabled (+2/-2)
lib/canonical/launchpad/webapp/tests/test_preferredcharsets.txt (+1/-1)
lib/canonical/launchpad/webapp/tests/test_request_expire_render.txt (+1/-1)
lib/canonical/lazr/doc/menus.txt (+2/-2)
lib/canonical/lazr/doc/timeout.txt (+1/-1)
lib/lp/answers/browser/tests/views.txt (+2/-2)
lib/lp/answers/doc/emailinterface.txt.disabled (+2/-2)
lib/lp/answers/doc/expiration.txt (+2/-2)
lib/lp/answers/doc/faq-vocabulary.txt (+2/-2)
lib/lp/answers/doc/faq.txt (+2/-2)
lib/lp/answers/doc/faqtarget.txt (+1/-1)
lib/lp/answers/doc/notifications.txt (+2/-2)
lib/lp/answers/doc/person.txt (+1/-1)
lib/lp/answers/doc/projectgroup.txt (+1/-1)
lib/lp/answers/doc/question.txt (+3/-3)
lib/lp/answers/doc/questionsets.txt (+1/-1)
lib/lp/answers/doc/questiontarget.txt (+1/-1)
lib/lp/answers/doc/workflow.txt (+1/-1)
lib/lp/answers/stories/distribution-package-answer-contact.txt (+2/-2)
lib/lp/answers/tests/questiontarget-sourcepackage.txt (+1/-1)
lib/lp/app/browser/tests/base-layout.txt (+1/-1)
lib/lp/app/browser/tests/launchpadform-view.txt (+2/-2)
lib/lp/app/doc/tales.txt (+3/-3)
lib/lp/app/stories/basics/xx-beta-testers-redirection.txt (+2/-2)
lib/lp/archivepublisher/tests/archive-signing.txt (+1/-1)
lib/lp/archivepublisher/tests/publishing-meta-data-files.txt (+2/-2)
lib/lp/archiveuploader/tests/nascentupload-announcements.txt (+5/-4)
lib/lp/archiveuploader/tests/nascentupload-closing-bugs.txt (+3/-2)
lib/lp/archiveuploader/tests/nascentupload-packageset.txt (+5/-4)
lib/lp/archiveuploader/tests/nascentupload.txt (+5/-5)
lib/lp/archiveuploader/tests/upload-karma.txt (+2/-2)
lib/lp/archiveuploader/tests/uploadpolicy.txt (+2/-2)
lib/lp/blueprints/doc/spec-mail-exploder.txt (+1/-1)
lib/lp/blueprints/doc/specgraph.txt (+1/-1)
lib/lp/blueprints/doc/specification-branch.txt (+1/-1)
lib/lp/blueprints/doc/specification-notifications.txt (+1/-1)
lib/lp/blueprints/doc/specification.txt (+2/-2)
lib/lp/blueprints/doc/sprint-agenda.txt (+1/-1)
lib/lp/blueprints/doc/sprint-meeting-export.txt (+2/-2)
lib/lp/blueprints/doc/sprint.txt (+3/-3)
lib/lp/blueprints/stories/sprints/20-sprint-registration.txt (+1/-1)
lib/lp/bugs/browser/tests/bug-nomination-views.txt (+1/-1)
lib/lp/bugs/browser/tests/bug-views.txt (+13/-4)
lib/lp/bugs/browser/tests/buglinktarget-views.txt (+3/-2)
lib/lp/bugs/browser/tests/bugs-views.txt (+2/-2)
lib/lp/bugs/browser/tests/bugtask-adding-views.txt (+3/-3)
lib/lp/bugs/browser/tests/bugtask-edit-views.txt (+3/-3)
lib/lp/bugs/browser/tests/bugtask-search-views.txt (+3/-3)
lib/lp/bugs/browser/tests/distrosourcepackage-bug-views.txt (+2/-2)
lib/lp/bugs/browser/tests/person-bug-views.txt (+1/-1)
lib/lp/bugs/doc/bug-change.txt (+1/-1)
lib/lp/bugs/doc/bug-export.txt (+4/-3)
lib/lp/bugs/doc/bug-nomination.txt (+1/-1)
lib/lp/bugs/doc/bug-private-by-default.txt (+3/-2)
lib/lp/bugs/doc/bug-reported-acknowledgement.txt (+3/-2)
lib/lp/bugs/doc/bug-reporting-guidelines.txt (+3/-2)
lib/lp/bugs/doc/bug-set-status.txt (+2/-2)
lib/lp/bugs/doc/bug-tags.txt (+3/-3)
lib/lp/bugs/doc/bug.txt (+1/-1)
lib/lp/bugs/doc/bugactivity.txt (+8/-4)
lib/lp/bugs/doc/bugattachments.txt (+9/-4)
lib/lp/bugs/doc/bugcomment.txt (+1/-1)
lib/lp/bugs/doc/bugmessage-visibility.txt (+1/-1)
lib/lp/bugs/doc/bugnotification-email.txt (+12/-5)
lib/lp/bugs/doc/bugnotification-sending.txt (+3/-3)
lib/lp/bugs/doc/bugnotification-threading.txt (+1/-1)
lib/lp/bugs/doc/bugnotificationrecipients.txt (+2/-2)
lib/lp/bugs/doc/bugnotifications.txt (+11/-6)
lib/lp/bugs/doc/bugsubscription.txt (+5/-3)
lib/lp/bugs/doc/bugtarget.txt (+3/-2)
lib/lp/bugs/doc/bugtask-bugwatch-widget.txt (+1/-1)
lib/lp/bugs/doc/bugtask-expiration.txt (+7/-4)
lib/lp/bugs/doc/bugtask-find-similar.txt (+4/-3)
lib/lp/bugs/doc/bugtask-package-widget.txt (+1/-1)
lib/lp/bugs/doc/bugtask-retrieval.txt (+4/-2)
lib/lp/bugs/doc/bugtask-search.txt (+14/-7)
lib/lp/bugs/doc/bugtask-status-workflow.txt (+3/-2)
lib/lp/bugs/doc/bugtask.txt (+7/-5)
lib/lp/bugs/doc/bugtracker.txt (+3/-3)
lib/lp/bugs/doc/bugwatch.txt (+13/-8)
lib/lp/bugs/doc/bugwidget.txt (+1/-1)
lib/lp/bugs/doc/bugzilla-import.txt (+3/-2)
lib/lp/bugs/doc/checkwatches-batching.txt (+1/-1)
lib/lp/bugs/doc/checkwatches-cli-switches.txt (+1/-1)
lib/lp/bugs/doc/checkwatches.txt (+6/-7)
lib/lp/bugs/doc/displaying-bugs-and-tasks.txt (+6/-4)
lib/lp/bugs/doc/externalbugtracker-bug-imports.txt (+3/-3)
lib/lp/bugs/doc/externalbugtracker-bugzilla-api.txt (+1/-1)
lib/lp/bugs/doc/externalbugtracker-bugzilla-lp-plugin.txt (+1/-1)
lib/lp/bugs/doc/externalbugtracker-bugzilla-oddities.txt (+2/-2)
lib/lp/bugs/doc/externalbugtracker-bugzilla.txt (+4/-3)
lib/lp/bugs/doc/externalbugtracker-comment-imports.txt (+8/-5)
lib/lp/bugs/doc/externalbugtracker-comment-pushing.txt (+9/-7)
lib/lp/bugs/doc/externalbugtracker-debbugs.txt (+7/-5)
lib/lp/bugs/doc/externalbugtracker-emailaddress.txt (+5/-2)
lib/lp/bugs/doc/externalbugtracker-mantis-csv.txt (+1/-1)
lib/lp/bugs/doc/externalbugtracker-mantis.txt (+3/-3)
lib/lp/bugs/doc/externalbugtracker-roundup.txt (+3/-3)
lib/lp/bugs/doc/externalbugtracker-rt.txt (+6/-5)
lib/lp/bugs/doc/externalbugtracker-sourceforge.txt (+3/-3)
lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt (+5/-3)
lib/lp/bugs/doc/externalbugtracker-trac.txt (+4/-4)
lib/lp/bugs/doc/externalbugtracker.txt (+1/-1)
lib/lp/bugs/doc/hasbugs.txt (+6/-3)
lib/lp/bugs/doc/initial-bug-contacts.txt (+1/-1)
lib/lp/bugs/doc/malone-karma.txt (+8/-4)
lib/lp/bugs/doc/malone-xmlrpc.txt (+7/-5)
lib/lp/bugs/doc/official-bug-tags.txt (+3/-3)
lib/lp/bugs/doc/security-teams.txt (+4/-4)
lib/lp/bugs/doc/sourceforge-remote-products.txt (+1/-1)
lib/lp/bugs/stories/bug-privacy/40-unsubscribe-from-private-bug.txt (+4/-3)
lib/lp/bugs/stories/bug-tags/xx-official-bug-tags.txt (+12/-1)
lib/lp/bugs/stories/bugattachments/xx-attachments-to-bug-report.txt (+1/-1)
lib/lp/bugs/stories/bugs/xx-bug-nomination-table-row.txt (+1/-1)
lib/lp/bugs/stories/bugs/xx-bugs-advanced-search-upstream-status.txt (+3/-2)
lib/lp/bugs/stories/bugs/xx-front-page-bug-lists.txt (+5/-2)
lib/lp/bugs/stories/bugs/xx-incomplete-bugs.txt (+1/-1)
lib/lp/bugs/stories/bugs/xx-portlets-bug-milestones.txt (+1/-1)
lib/lp/bugs/stories/bugs/xx-remote-bug-comments.txt (+1/-1)
lib/lp/bugs/stories/bugtask-management/xx-bug-importance-change.txt (+3/-2)
lib/lp/bugs/stories/bugtask-searches/xx-listing-basics.txt (+3/-2)
lib/lp/bugs/stories/bugtask-searches/xx-searching-by-tags.txt (+3/-2)
lib/lp/bugs/stories/bugwatches/xx-edit-bugwatch.txt (+1/-1)
lib/lp/bugs/stories/cve/cve-linking.txt (+1/-1)
lib/lp/bugs/stories/feeds/xx-bug-atom.txt (+1/-1)
lib/lp/bugs/stories/feeds/xx-bug-html.txt (+4/-2)
lib/lp/bugs/stories/structural-subscriptions/xx-bug-subscriptions.txt (+2/-2)
lib/lp/bugs/stories/webservice/xx-bug.txt (+1/-1)
lib/lp/bugs/tests/buglinktarget.txt (+5/-2)
lib/lp/bugs/tests/bugs-emailinterface.txt (+6/-7)
lib/lp/bugs/tests/bugtarget-questiontarget.txt (+5/-4)
lib/lp/code/browser/tests/test_branchlisting.py (+33/-0)
lib/lp/code/doc/branch-merge-proposal-notifications.txt (+4/-3)
lib/lp/code/doc/branch-visibility.txt (+1/-1)
lib/lp/code/doc/codeimport-event.txt (+1/-1)
lib/lp/code/doc/codeimport-job.txt (+1/-1)
lib/lp/code/doc/codeimport.txt (+2/-2)
lib/lp/code/model/branch.py (+2/-1)
lib/lp/code/model/branchmergeproposal.py (+6/-0)
lib/lp/code/model/tests/test_branchmergeproposal.py (+48/-4)
lib/lp/code/model/tests/test_branchmergeproposaljobs.py (+5/-3)
lib/lp/code/stories/branches/xx-branch-deletion.txt (+1/-1)
lib/lp/code/stories/branches/xx-branch-index.txt (+2/-2)
lib/lp/code/stories/branches/xx-branchmergeproposal-listings.txt (+1/-1)
lib/lp/code/stories/branches/xx-branchmergeproposals.txt (+2/-2)
lib/lp/code/stories/branches/xx-creating-branches.txt (+2/-2)
lib/lp/code/stories/branches/xx-private-branch-listings.txt (+1/-1)
lib/lp/code/stories/branches/xx-project-branches.txt (+4/-2)
lib/lp/code/stories/codeimport/xx-failing-codeimport.txt (+1/-1)
lib/lp/code/stories/feeds/xx-revision-atom.txt (+1/-1)
lib/lp/code/stories/webservice/xx-branch.txt (+1/-1)
lib/lp/code/templates/branch-index.pt (+11/-8)
lib/lp/code/templates/branch-information.pt (+1/-1)
lib/lp/code/templates/branch-related-bugs-specs.pt (+5/-1)
lib/lp/code/templates/project-branches.pt (+27/-2)
lib/lp/code/tests/test_project.py (+36/-0)
lib/lp/coop/answersbugs/stories/question-buglink.txt (+1/-1)
lib/lp/coop/answersbugs/tests/notifications-linked-bug.txt (+2/-2)
lib/lp/hardwaredb/doc/hwdb-device-tables.txt (+4/-2)
lib/lp/hardwaredb/doc/hwdb-submission.txt (+1/-1)
lib/lp/hardwaredb/doc/hwdb.txt (+8/-6)
lib/lp/registry/browser/tests/coc-views.txt (+1/-1)
lib/lp/registry/browser/tests/milestone-views.txt (+2/-2)
lib/lp/registry/browser/tests/peoplemerge-views.txt (+1/-1)
lib/lp/registry/browser/tests/person-admin-views.txt (+1/-1)
lib/lp/registry/browser/tests/person-views.txt (+2/-4)
lib/lp/registry/browser/tests/pillar-views.txt (+2/-2)
lib/lp/registry/browser/tests/poll-views_0.txt (+2/-2)
lib/lp/registry/browser/tests/private-team-creation-views.txt (+4/-2)
lib/lp/registry/browser/tests/product-portlet-packages-view.txt (+5/-3)
lib/lp/registry/browser/tests/product-views.txt (+2/-2)
lib/lp/registry/browser/tests/team-views.txt (+20/-12)
lib/lp/registry/configure.zcml (+4/-1)
lib/lp/registry/doc/announcement.txt (+4/-2)
lib/lp/registry/doc/commercialsubscription.txt (+2/-2)
lib/lp/registry/doc/distribution-mirror.txt (+13/-5)
lib/lp/registry/doc/distribution-sourcepackage.txt (+3/-3)
lib/lp/registry/doc/distribution.txt (+3/-6)
lib/lp/registry/doc/distroseries.txt (+11/-10)
lib/lp/registry/doc/entitlement.txt (+10/-5)
lib/lp/registry/doc/featuredproject.txt (+4/-3)
lib/lp/registry/doc/gpg-signatures.txt (+1/-1)
lib/lp/registry/doc/gpgkey.txt (+5/-2)
lib/lp/registry/doc/irc.txt (+1/-1)
lib/lp/registry/doc/jabber.txt (+1/-1)
lib/lp/registry/doc/karmacache.txt (+3/-3)
lib/lp/registry/doc/karmacontext.txt (+4/-2)
lib/lp/registry/doc/mailinglist-subscriptions-xmlrpc.txt (+2/-2)
lib/lp/registry/doc/mailinglists.txt (+5/-3)
lib/lp/registry/doc/mentoringoffer.txt (+8/-5)
lib/lp/registry/doc/message-holds.txt (+1/-1)
lib/lp/registry/doc/milestone.txt (+6/-5)
lib/lp/registry/doc/person-account.txt (+3/-3)
lib/lp/registry/doc/person-karma.txt (+5/-3)
lib/lp/registry/doc/person-notification.txt (+1/-1)
lib/lp/registry/doc/person.txt (+15/-10)
lib/lp/registry/doc/personlocation.txt (+2/-2)
lib/lp/registry/doc/pillar-aliases-field.txt (+1/-1)
lib/lp/registry/doc/pillar.txt (+6/-5)
lib/lp/registry/doc/poll-preconditions.txt (+1/-1)
lib/lp/registry/doc/poll.txt (+6/-2)
lib/lp/registry/doc/product-widgets.txt (+2/-2)
lib/lp/registry/doc/product.txt (+5/-2)
lib/lp/registry/doc/productrelease-file-download.txt (+3/-3)
lib/lp/registry/doc/productseries.txt (+7/-4)
lib/lp/registry/doc/projectgroup.txt (+4/-2)
lib/lp/registry/doc/sshkey.txt (+5/-2)
lib/lp/registry/doc/standing.txt (+6/-4)
lib/lp/registry/doc/structural-subscriptions.txt (+5/-5)
lib/lp/registry/doc/team-nav-menus.txt (+3/-3)
lib/lp/registry/doc/teammembership-email-notification.txt (+8/-4)
lib/lp/registry/doc/teammembership.txt (+5/-3)
lib/lp/registry/doc/user-to-user.txt (+1/-1)
lib/lp/registry/doc/wikiname.txt (+1/-1)
lib/lp/registry/interfaces/projectgroup.py (+7/-0)
lib/lp/registry/model/projectgroup.py (+9/-0)
lib/lp/registry/stories/announcements/xx-announcements.txt (+4/-2)
lib/lp/registry/stories/distributionmirror/xx-distribution-countrymirrors.txt (+2/-2)
lib/lp/registry/stories/gpg-coc/01-claimgpg.txt (+2/-2)
lib/lp/registry/stories/gpg-coc/04-reactivategpg.txt (+1/-1)
lib/lp/registry/stories/gpg-coc/11-handle-special-keys.txt (+1/-1)
lib/lp/registry/stories/mailinglists/lifecycle.txt (+1/-1)
lib/lp/registry/stories/mailinglists/subscriptions.txt (+2/-2)
lib/lp/registry/stories/person/xx-person-editgpgkeys-invalid-key.txt (+3/-3)
lib/lp/registry/stories/pillar/xx-pillar-deactivation.txt (+2/-2)
lib/lp/registry/stories/productrelease/xx-productrelease-basics.txt (+1/-1)
lib/lp/registry/stories/team/xx-adminteammerge.txt (+1/-1)
lib/lp/registry/stories/team/xx-team-membership.txt (+2/-2)
lib/lp/registry/stories/teammembership/10-join-team.txt (+1/-1)
lib/lp/registry/stories/teammembership/xx-expire-subscription.txt (+1/-1)
lib/lp/registry/stories/teammembership/xx-member-renewed-membership.txt (+5/-2)
lib/lp/registry/stories/vouchers/xx-voucher-redemption.txt (+1/-1)
lib/lp/registry/stories/webservice/xx-distribution-mirror.txt (+1/-1)
lib/lp/registry/stories/webservice/xx-distribution.txt (+1/-1)
lib/lp/registry/stories/webservice/xx-person.txt (+1/-1)
lib/lp/registry/stories/webservice/xx-private-team.txt (+1/-1)
lib/lp/registry/templates/team-members.pt (+5/-0)
lib/lp/registry/tests/structural-subscription-target.txt (+1/-2)
lib/lp/services/fields/doc/uri-field.txt (+2/-2)
lib/lp/services/inlinehelp/README.txt (+3/-3)
lib/lp/services/mail/tests/incomingmail.txt (+2/-2)
lib/lp/services/mailman/doc/batching.txt (+1/-1)
lib/lp/services/mailman/doc/bounces.txt (+1/-1)
lib/lp/services/mailman/doc/postings.txt (+2/-2)
lib/lp/services/mailman/doc/recovery.txt (+4/-2)
lib/lp/services/mailman/doc/staging.txt (+1/-1)
lib/lp/services/mailman/doc/subscriptions.txt (+2/-2)
lib/lp/services/memcache/doc/tales-cache.txt (+2/-2)
lib/lp/soyuz/browser/tests/binarypackagerelease-views.txt (+2/-2)
lib/lp/soyuz/browser/tests/build-views.txt (+1/-1)
lib/lp/soyuz/browser/tests/builder-views.txt (+2/-2)
lib/lp/soyuz/browser/tests/distroseriesqueue-views.txt (+2/-2)
lib/lp/soyuz/browser/tests/sourcepackage-views.txt (+1/-1)
lib/lp/soyuz/doc/archive-files.txt (+1/-1)
lib/lp/soyuz/doc/archivepermission.txt (+3/-2)
lib/lp/soyuz/doc/binarypackagebuild.txt (+3/-3)
lib/lp/soyuz/doc/binarypackagerelease.txt (+7/-6)
lib/lp/soyuz/doc/buildd-dispatching.txt (+1/-1)
lib/lp/soyuz/doc/buildd-scoring.txt (+2/-3)
lib/lp/soyuz/doc/buildd-slavescanner.txt (+2/-2)
lib/lp/soyuz/doc/closing-bugs-from-changelogs.txt (+2/-2)
lib/lp/soyuz/doc/components-and-sections.txt (+3/-3)
lib/lp/soyuz/doc/distribution.txt (+2/-2)
lib/lp/soyuz/doc/distroarchseries.txt (+5/-6)
lib/lp/soyuz/doc/distroarchseriesbinarypackage.txt (+5/-6)
lib/lp/soyuz/doc/distroseries-publishing-lookups.txt (+2/-2)
lib/lp/soyuz/doc/distroseriesqueue-dist-upgrader.txt (+1/-1)
lib/lp/soyuz/doc/distroseriesqueue-notify.txt (+1/-1)
lib/lp/soyuz/doc/distroseriesqueue-translations.txt (+2/-2)
lib/lp/soyuz/doc/distroseriesqueue.txt (+8/-9)
lib/lp/soyuz/doc/fakepackager.txt (+2/-2)
lib/lp/soyuz/doc/gina-multiple-arch.txt (+1/-1)
lib/lp/soyuz/doc/manage-chroot.txt (+1/-1)
lib/lp/soyuz/doc/package-diff.txt (+5/-5)
lib/lp/soyuz/doc/package-meta-classes.txt (+2/-3)
lib/lp/soyuz/doc/packagecopyrequest.txt (+3/-3)
lib/lp/soyuz/doc/pocketchroot.txt (+1/-1)
lib/lp/soyuz/doc/publishing.txt (+16/-12)
lib/lp/soyuz/doc/queuebuilder.txt (+1/-1)
lib/lp/soyuz/doc/sourcepackagerelease-build-lookup.txt (+2/-2)
lib/lp/soyuz/doc/sourcepackagerelease.txt (+6/-5)
lib/lp/soyuz/doc/soyuz-files.txt (+7/-4)
lib/lp/soyuz/doc/soyuz-set-of-uploads.txt (+6/-4)
lib/lp/soyuz/doc/soyuz-upload.txt (+11/-5)
lib/lp/soyuz/stories/ppa/xx-copy-packages.txt (+2/-2)
lib/lp/soyuz/stories/ppa/xx-delete-packages.txt (+3/-2)
lib/lp/soyuz/stories/ppa/xx-ppa-files.txt (+1/-1)
lib/lp/soyuz/stories/ppa/xx-ppa-packages.txt (+1/-2)
lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt (+1/-1)
lib/lp/soyuz/stories/soyuz/xx-builds-pages.txt (+2/-2)
lib/lp/soyuz/stories/soyuz/xx-distribution-archives.txt (+1/-2)
lib/lp/soyuz/stories/soyuz/xx-package-diff.txt (+4/-4)
lib/lp/soyuz/stories/soyuz/xx-person-packages.txt (+2/-2)
lib/lp/soyuz/stories/soyuz/xx-private-builds.txt (+2/-2)
lib/lp/soyuz/stories/soyuz/xx-queue-pages-delayed-copies.txt (+1/-1)
lib/lp/soyuz/stories/soyuz/xx-queue-pages-motu.txt (+3/-2)
lib/lp/soyuz/stories/soyuz/xx-queue-pages.txt (+4/-4)
lib/lp/soyuz/stories/webservice/xx-archive.txt (+1/-1)
lib/lp/soyuz/stories/webservice/xx-archivedependency.txt (+1/-1)
lib/lp/soyuz/stories/webservice/xx-binary-package-publishing.txt (+1/-1)
lib/lp/soyuz/stories/webservice/xx-builds.txt (+3/-3)
lib/lp/soyuz/stories/webservice/xx-packageupload.txt (+2/-2)
lib/lp/soyuz/stories/webservice/xx-source-package-publishing.txt (+5/-5)
lib/lp/translations/browser/tests/pofile-base-views.txt (+1/-1)
lib/lp/translations/browser/tests/pofile-views.txt (+3/-3)
lib/lp/translations/browser/tests/potemplate-views.txt (+2/-2)
lib/lp/translations/browser/tests/translationimportqueue-views.txt (+1/-1)
lib/lp/translations/browser/tests/translationmessage-views.txt (+3/-3)
lib/lp/translations/doc/language-pack.txt (+1/-1)
lib/lp/translations/doc/poexport-language-pack.txt (+3/-3)
lib/lp/translations/doc/poexport-request-productseries.txt (+1/-1)
lib/lp/translations/doc/pofile.txt (+3/-3)
lib/lp/translations/doc/poimport.txt (+1/-1)
lib/lp/translations/doc/potemplate.txt (+1/-1)
lib/lp/translations/doc/potmsgset.txt (+3/-3)
lib/lp/translations/doc/rosetta-karma.txt (+1/-1)
lib/lp/translations/doc/translationimportqueue.txt (+1/-1)
lib/lp/translations/doc/translationmessage-destroy.txt (+1/-1)
lib/lp/translations/doc/translationmessage.txt (+1/-1)
lib/lp/translations/doc/translations-export-to-branch.txt (+1/-1)
lib/lp/translations/doc/translationsoverview.txt (+2/-2)
lib/lp/translations/doc/translationtemplatesbuildbehavior.txt (+1/-1)
lib/lp/translations/stories/buildfarm/xx-build-summary.txt (+1/-1)
lib/lp/translations/stories/productseries/xx-productseries-translations.txt (+1/-1)
lib/lp/translations/stories/standalone/xx-pofile-translate-message-filtering.txt (+1/-1)
lib/lp/translations/stories/standalone/xx-potemplate-edit.txt (+1/-1)
lib/lp/translations/stories/standalone/xx-sourcepackage-export.txt (+2/-2)
lib/lp/translations/stories/standalone/xx-translation-access-display.txt (+1/-1)
lib/lp/translations/stories/standalone/xx-translationmessage-translate.txt (+1/-1)
lib/lp/translations/stories/translationgroups/30-show-group-translation-targets.txt (+2/-2)
lib/lp/translations/stories/translationgroups/60-translation-suggestions.txt (+2/-2)
lib/lp/translations/tests/potmsgset-update-translation.txt (+1/-1)
utilities/migrater/deglob.py (+161/-2)
utilities/migrater/find.py (+30/-28)
To merge this branch: bzr merge lp:~leonardr/launchpad/temporary-integration
Reviewer Review Type Date Requested Status
Curtis Hovey (community) ui Approve
Guilherme Salgado (community) ui* Approve
Māris Fogels (community) Approve
Review via email: mp+38836@code.launchpad.net

Description of the change

For the first time, this branch makes it possible to create an OAuth access token with an expiration date. The feature is only available for a "desktop integration" type token, and it's intended to allow the end-user to try out desktop integration or temporarily enable access to their Launchpad account on someone else's computer.

When you go to authorize a "desktop integration" OAuth request token, you'll be presented with the normal "allow" and "deny" actions, but you'll also have "one hour", "one day" and "one week" actions. These actions are the same as the "allow" action, but they have a "duration" set, which is transformed into an expiration date when that action is processed.

The expiration date is stored in IOAuthRequestToken.date_expires, and copied over when the token is approved.

Note that it's possible to have more than one "desktop integration" token for a given computer name. In real life, this will only happen if you gave more than one computer the same name. (This does happen, though; someone might have two computers both called "ubuntu" or "localhost".)

To post a comment you must log in.
Revision history for this message
Māris Fogels (mars) wrote :

Hi Leonard,

This code looks good. r=mars.

I have some comments about the language in the OAuth UI: I prefer the wording of "Give all programs on this computer access..." over the phrase "Permanently integrate". Similarly, I prefer the wording of "I'd like to allow access for a day" over "I'd like to try the integration for a day". "Integration" is a very technical term. In contrast, the statement "I would like to do X for a day" sounds very concrete.

I suggest getting a review of the UI text for this. I ask because I have found that OAuth screens are a particularly important place to have good usability as they deal with security and the user's fragile confidence. Also, a screenshot with the UI text would help whomever does the usability review.

Maris

review: Approve
Revision history for this message
Leonard Richardson (leonardr) wrote :

Asking for a UI review. Specific questions for the UI reviewer:

* Wording of the buttons, as flagged by Maris.
* Is the expiration text okay? If you choose a one-week trial it prints a date, eg. "The integration you just authorized will expire 2010-10-26." A little awkward, but not ungrammatical.

Revision history for this message
Curtis Hovey (sinzui) wrote :

I would like Salgado to review the UI. The screencap URL is at https://pastebin.canonical.com/38817/

review: Abstain (ui)
Revision history for this message
Guilherme Salgado (salgado) wrote :

Hi Leonard,

Here are a few suggestions that could help improve things a bit. Given that most of them are wording-related, I'd like Matt Revell to review them as he might have other suggestions.

- Where does the "Ubuntu desktop" part come from? I don't think there's
  anything restricting that page only to Ubuntu desktops, so users of other
  distros might feel either left out or compelled to click "No, thanks".

- I think the heading and the first sentence should make it clear that this
  will give any application on that computer full access to their Launchpad
  account. I say that because the heading just talks about integration, which
  might lead people to think it's something else.

  Maybe we could use something similar to what U1 uses: "Confirm Computer
  Access" as the heading and "Would you like to give all applications running
  on <mycomputer> full access (including making changes) to your Launchpad
  account?"

- I agree with Maris that the word of the buttons should be changed to make
  it clear the user is granting the computer full access to their LP
  account. Also, we can probably avoid the repetition in the buttons by doing
  something like this:

    Allow "mycomputer" to Access my Launchpad Account
        [ Permanently ]
        [ For One Hour ]
        [ For One Day ]
        [ For One Week ]

    Do Not Allow "mycomputer" to Access my Launchpad Account

- Buttons should be Headling Case
  (https://dev.launchpad.net/UserInterfaceWording)

review: Needs Fixing (ui*)
Revision history for this message
Leonard Richardson (leonardr) wrote :

"Ubuntu desktop" comes from a string provided by the client. Users of other distros will see different strings.

Revision history for this message
Leonard Richardson (leonardr) wrote :

I'd also appreciate some advice on how to group the action buttons into two sets. Should I just put two Actions objects into the context, "allow_actions" and "deny_action"?

Revision history for this message
Curtis Hovey (sinzui) wrote :

Why does the page look unstyled? I expect to see the text to use the Ubuntu font. The text lines are difficult to read because of their length. Launchpad's CSS sets the max-width: 45em.

Revision history for this message
Guilherme Salgado (salgado) wrote :

On Wed, 2010-10-20 at 13:04 +0000, Leonard Richardson wrote:
> I'd also appreciate some advice on how to group the action buttons
> into two sets. Should I just put two Actions objects into the context,
> "allow_actions" and "deny_action"?

Why do you want them in two sets?

I think that to render the buttons like I proposed you'll need to do so
manually. You'd still define all your @action methods normally but then
in your template you fill the "buttons" slot and layout the buttons as
you want.

Revision history for this message
Leonard Richardson (leonardr) wrote :

The *screenshot* looks unstyled because the easiest way for me to take a screenshot was to write the HTML file to disk during a test run and view it locally. The page is a normal Launchpad page and when viewed as part of a running Launchpad instance it will be styled.

I don't understand "in your template you fill the "buttons" slot and layout the buttons as you want". Currently I have this code:

<div metal:fill-slot="buttons" />

As I understand it, this invokes some kind of macro that takes my Actions object and automagically lays out the buttons, one per column.

Are you suggesting something like this?

<div metal fill-slot="buttons">

  Allow "mycomputer" to Access my Launchpad Account

 <div class="indented" id="do-integrate">
  <input type="button" name="Permanently" />
  <input type="button" name="One hour" />
  <input type="button" name="One day" />
  <input type="button" name="One week" />
 </div>

 <!--Note: no "indented" div here-->
  <input type="button" name="Don't integrate" />
</div>

That is, I'm trying to get this effect:

  Allow "mycomputer" to Access my Launchpad Account
        [ Permanently ]
        [ For One Hour ]
        [ For One Day ]
        [ For One Week ]

    Do Not Allow "mycomputer" to Access my Launchpad Account

But I have no idea how to do this, either on the level of the CSS styling or the level of the PT templates. I would prefer not to lay out all four of the "yes, i want to integrate" buttons manually--that's why I suggested having two Actions objects.

Can you help me?

Revision history for this message
Curtis Hovey (sinzui) wrote :

On Wed, 2010-10-20 at 15:13 +0000, Leonard Richardson wrote:
> <div metal fill-slot="buttons">
>
> Allow "mycomputer" to Access my Launchpad Account
>
> <div class="indented" id="do-integrate">
> <input type="button" name="Permanently" />
> <input type="button" name="One hour" />
> <input type="button" name="One day" />
> <input type="button" name="One week" />
> </div>
>
> <!--Note: no "indented" div here-->
> <input type="button" name="Don't integrate" />
> </div>

The question-index.pt template renders its button manually:

            <div class="actions" metal:fill-slot="buttons">
              <div>
                <input tal:replace="structure view/answer_action/render" />
                <input tal:replace="structure view/selfanswer_action/render" />
                <input tal:replace="structure view/requestinfo_action/render" />
                <input tal:replace="structure view/giveinfo_action/render" />
                <input tal:replace="structure view/reopen_action/render" />
                <input tal:replace="structure view/comment_action/render" />
              </div>

I think you want to add some structure around the buttons to group them.
You will need <br/> or wrap each is a <div> to create the vertical list.

Revision history for this message
Guilherme Salgado (salgado) wrote :
review: Approve (ui*)
Revision history for this message
Curtis Hovey (sinzui) wrote :

On IRC we tried a 6th layout and discussed capitalisation. We agreed 6 was a little better than 5.

review: Approve (ui)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'buildout-templates/bin/kill-test-services.in'
--- buildout-templates/bin/kill-test-services.in 2010-04-20 19:10:35 +0000
+++ buildout-templates/bin/kill-test-services.in 2010-10-21 19:08:55 +0000
@@ -19,8 +19,7 @@
19import sys19import sys
2020
21from canonical.testing.layers import MemcachedLayer21from canonical.testing.layers import MemcachedLayer
22from canonical.librarian.ftests.harness import (22from canonical.librarian.testing.server import LibrarianTestSetup
23 LibrarianTestSetup, TacLibrarianTestSetup)
24from lp.services.osutils import kill_by_pidfile23from lp.services.osutils import kill_by_pidfile
2524
2625
@@ -32,7 +31,6 @@
32 kill_by_pidfile(MemcachedLayer.getPidFile())31 kill_by_pidfile(MemcachedLayer.getPidFile())
33 print "done."32 print "done."
34 print "Killing Librarian....",33 print "Killing Librarian....",
35 TacLibrarianTestSetup().tearDown()
36 LibrarianTestSetup().tearDownRoot()34 LibrarianTestSetup().tearDownRoot()
37 print "done."35 print "done."
38 return 036 return 0
3937
=== modified file 'lib/canonical/database/ftests/test_multitablecopy.txt'
--- lib/canonical/database/ftests/test_multitablecopy.txt 2008-05-19 15:24:34 +0000
+++ lib/canonical/database/ftests/test_multitablecopy.txt 2010-10-21 19:08:55 +0000
@@ -5,8 +5,8 @@
55
6 >>> import transaction6 >>> import transaction
7 >>> from canonical.database import postgresql7 >>> from canonical.database import postgresql
8 >>> from canonical.database.multitablecopy import MultiTableCopy
8 >>> from canonical.database.sqlbase import cursor9 >>> from canonical.database.sqlbase import cursor
9 >>> from canonical.database.multitablecopy import MultiTableCopy
1010
11 >>> # Keep track of tables we'll want to clean up later11 >>> # Keep track of tables we'll want to clean up later
12 >>> tables_to_clean_up = []12 >>> tables_to_clean_up = []
1313
=== modified file 'lib/canonical/launchpad/browser/ftests/logintoken-corner-cases.txt'
--- lib/canonical/launchpad/browser/ftests/logintoken-corner-cases.txt 2010-10-03 15:30:06 +0000
+++ lib/canonical/launchpad/browser/ftests/logintoken-corner-cases.txt 2010-10-21 19:08:55 +0000
@@ -11,11 +11,11 @@
11redirect to the default token view. This would happen if for example the11redirect to the default token view. This would happen if for example the
12user tried to re-post the form after validating one of their email addresses.12user tried to re-post the form after validating one of their email addresses.
1313
14 >>> from lp.registry.interfaces.person import IPersonSet
15 >>> from canonical.launchpad.interfaces import (
16 ... ILoginTokenSet, LoginTokenType)
17 >>> from canonical.launchpad.browser import ValidateEmailView14 >>> from canonical.launchpad.browser import ValidateEmailView
15 >>> from canonical.launchpad.interfaces.authtoken import LoginTokenType
16 >>> from canonical.launchpad.interfaces.logintoken import ILoginTokenSet
18 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest17 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
18 >>> from lp.registry.interfaces.person import IPersonSet
1919
20 >>> foo_bar = getUtility(IPersonSet).getByName('name16')20 >>> foo_bar = getUtility(IPersonSet).getByName('name16')
21 >>> token = getUtility(ILoginTokenSet).new(21 >>> token = getUtility(ILoginTokenSet).new(
2222
=== modified file 'lib/canonical/launchpad/browser/oauth.py'
--- lib/canonical/launchpad/browser/oauth.py 2010-10-04 20:33:07 +0000
+++ lib/canonical/launchpad/browser/oauth.py 2010-10-21 19:08:55 +0000
@@ -9,12 +9,19 @@
9 'OAuthTokenAuthorizedView',9 'OAuthTokenAuthorizedView',
10 'lookup_oauth_context']10 'lookup_oauth_context']
1111
12from datetime import (
13 datetime,
14 timedelta,
15 )
16
12from lazr.restful import HTTPResource17from lazr.restful import HTTPResource
18import pytz
13import simplejson19import simplejson
14from zope.component import getUtility20from zope.component import getUtility
15from zope.formlib.form import (21from zope.formlib.form import (
16 Action,22 Action,
17 Actions,23 Actions,
24 expandPrefix,
18 )25 )
19from zope.security.interfaces import Unauthorized26from zope.security.interfaces import Unauthorized
2027
@@ -63,7 +70,7 @@
63 return simplejson.dumps(structure)70 return simplejson.dumps(structure)
6471
6572
66class OAuthRequestTokenView(LaunchpadView, JSONTokenMixin):73class OAuthRequestTokenView(LaunchpadFormView, JSONTokenMixin):
67 """Where consumers can ask for a request token."""74 """Where consumers can ask for a request token."""
6875
69 def __call__(self):76 def __call__(self):
@@ -107,7 +114,21 @@
107114
108def token_review_success(form, action, data):115def token_review_success(form, action, data):
109 """The success callback for a button to approve a token."""116 """The success callback for a button to approve a token."""
110 form.reviewToken(action.permission)117 form.reviewToken(action.permission, action.duration)
118
119
120class TemporaryIntegrations:
121 """Contains duration constants for temporary integrations."""
122
123 HOUR = "Hour"
124 DAY = "Day"
125 WEEK = "Week"
126
127 DURATION = {
128 HOUR : 60 * 60,
129 DAY : 60 * 60 * 24,
130 WEEK : 60 * 60 * 24 * 7
131 }
111132
112133
113def create_oauth_permission_actions():134def create_oauth_permission_actions():
@@ -115,19 +136,37 @@
115136
116 The first `Actions` object contains every action supported by the137 The first `Actions` object contains every action supported by the
117 OAuthAuthorizeTokenView. The second list contains a good default138 OAuthAuthorizeTokenView. The second list contains a good default
118 set of actions, omitting special permissions like DESKTOP_INTEGRATION.139 set of actions, omitting special actions like the
140 DESKTOP_INTEGRATION ones.
119 """141 """
120 all_actions = Actions()142 all_actions = Actions()
121 ordinary_actions = Actions()143 ordinary_actions = Actions()
144 desktop_permission = OAuthPermission.DESKTOP_INTEGRATION
122 for permission in OAuthPermission.items:145 for permission in OAuthPermission.items:
123 action = Action(146 action = Action(
124 permission.title, name=permission.name,147 permission.title, name=permission.name,
125 success=token_review_success,148 success=token_review_success,
126 condition=token_exists_and_is_not_reviewed)149 condition=token_exists_and_is_not_reviewed)
127 action.permission = permission150 action.permission = permission
151 action.duration = None
128 all_actions.append(action)152 all_actions.append(action)
129 if permission != OAuthPermission.DESKTOP_INTEGRATION:153 if permission != desktop_permission:
130 ordinary_actions.append(action)154 ordinary_actions.append(action)
155
156 # Add special actions for the time-limited DESKTOP_INTEGRATION
157 # tokens.
158 for duration in (
159 TemporaryIntegrations.HOUR, TemporaryIntegrations.DAY,
160 TemporaryIntegrations.WEEK):
161 action = Action(
162 ("For One %s" % duration),
163 name=expandPrefix(desktop_permission.name) + duration,
164 success=token_review_success,
165 condition=token_exists_and_is_not_reviewed)
166 action.permission = desktop_permission
167 action.duration = duration
168 all_actions.append(action)
169
131 return all_actions, ordinary_actions170 return all_actions, ordinary_actions
132171
133172
@@ -161,7 +200,8 @@
161 used by normal applications.200 used by normal applications.
162 """201 """
163202
164 allowed_permissions = self.request.form_ng.getAll('allow_permission')203 allowed_permissions = set(
204 self.request.form_ng.getAll('allow_permission'))
165 if len(allowed_permissions) == 0:205 if len(allowed_permissions) == 0:
166 return self.actions_excluding_special_permissions206 return self.actions_excluding_special_permissions
167 actions = Actions()207 actions = Actions()
@@ -174,9 +214,10 @@
174214
175 # DESKTOP_INTEGRATION cannot be requested as one of several215 # DESKTOP_INTEGRATION cannot be requested as one of several
176 # options--it must be the only option (other than216 # options--it must be the only option (other than
177 # UNAUTHORIZED). If DESKTOP_INTEGRATION is one of several217 # UNAUTHORIZED). If there is any item in the list that doesn't
178 # options, remove it from the list.218 # use DESKTOP_INTEGRATION, remove it from the list.
179 desktop_permission = OAuthPermission.DESKTOP_INTEGRATION219 desktop_permission = OAuthPermission.DESKTOP_INTEGRATION
220
180 if (desktop_permission.name in allowed_permissions221 if (desktop_permission.name in allowed_permissions
181 and len(allowed_permissions) > 1):222 and len(allowed_permissions) > 1):
182 allowed_permissions.remove(desktop_permission.name)223 allowed_permissions.remove(desktop_permission.name)
@@ -192,33 +233,40 @@
192 "the computer being integrated."233 "the computer being integrated."
193 % self.token.consumer.key))234 % self.token.consumer.key))
194235
195 # We're going for desktop integration. The only two236 # We're going for desktop integration. There are four
196 # possibilities are "allow" and "deny". We'll customize237 # possibilities: "allow permanently", "allow for one
197 # the "allow" message using the hostname provided by the238 # hour", "allow for one day", "allow for one week", and
198 # desktop.239 # "deny". We'll customize the "allow permanently" and
240 # "deny" message using the hostname provided by the
241 # desktop. We'll use the existing Action objects for the
242 # "temporary integration" actions, without customizing
243 # their messages.
199 #244 #
200 # Since self.actions is a descriptor that returns copies245 # Since self.actions is a descriptor that returns copies
201 # of Action objects, we can modify the actions we get246 # of Action objects, we can modify the actions we get
202 # in-place without ruining the Action objects for everyone247 # in-place without ruining the Action objects for everyone
203 # else.248 # else.
204 desktop_name = self.token.consumer.integrated_desktop_name249 desktop_name = self.token.consumer.integrated_desktop_name
205 label = (
206 'Give all programs running on &quot;%s&quot; access '
207 'to my Launchpad account.')
208 allow_action = [250 allow_action = [
209 action for action in self.actions251 action for action in self.actions
210 if action.name == desktop_permission.name][0]252 if action.name == desktop_permission.name][0]
211 allow_action.label = label % desktop_name253 allow_action.label = "Until I Disable It"
212 actions.append(allow_action)254 actions.append(allow_action)
213255
214 # We'll customize the "deny" message as well.256 # Bring in all of the temporary integration actions.
215 label = "No, thanks, I don't trust &quot;%s&quot;."257 for action in self.actions:
258 if (action.permission == desktop_permission
259 and action.name != desktop_permission.name):
260 actions.append(action)
261
262 # Fionally, customize the "deny" message.
263 label = (
264 "Do Not Allow &quot;%s&quot; to Access my Launchpad Account.")
216 deny_action = [265 deny_action = [
217 action for action in self.actions266 action for action in self.actions
218 if action.name == OAuthPermission.UNAUTHORIZED.name][0]267 if action.name == OAuthPermission.UNAUTHORIZED.name][0]
219 deny_action.label = label % desktop_name268 deny_action.label = label % desktop_name
220 actions.append(deny_action)269 actions.append(deny_action)
221
222 else:270 else:
223 # We're going for web-based integration.271 # We're going for web-based integration.
224 for action in self.actions_excluding_special_permissions:272 for action in self.actions_excluding_special_permissions:
@@ -237,6 +285,25 @@
237 return self.actions_excluding_special_permissions285 return self.actions_excluding_special_permissions
238 return actions286 return actions
239287
288 @property
289 def visible_desktop_integration_actions(self):
290 """Return all visible actions for DESKTOP_INTEGRATION."""
291 actions = Actions()
292 for action in self.visible_actions:
293 if action.permission is OAuthPermission.DESKTOP_INTEGRATION:
294 actions.append(action)
295 return actions
296
297 @property
298 def unauthorized_action(self):
299 """Returns just the action for the UNAUTHORIZED permission level."""
300 for action in self.visible_actions:
301 if action.permission is OAuthPermission.UNAUTHORIZED:
302 return action
303 raise AssertionError(
304 "UNAUTHORIZED permission level should always be visible, "
305 "but wasn't.")
306
240 def initialize(self):307 def initialize(self):
241 self.storeTokenContext()308 self.storeTokenContext()
242 form = get_oauth_authorization(self.request)309 form = get_oauth_authorization(self.request)
@@ -244,7 +311,6 @@
244 if key:311 if key:
245 self.token = getUtility(IOAuthRequestTokenSet).getByKey(key)312 self.token = getUtility(IOAuthRequestTokenSet).getByKey(key)
246313
247
248 callback = self.request.form.get('oauth_callback')314 callback = self.request.form.get('oauth_callback')
249 if (self.token is not None315 if (self.token is not None
250 and self.token.consumer.is_integrated_desktop):316 and self.token.consumer.is_integrated_desktop):
@@ -295,8 +361,16 @@
295 raise UnexpectedFormData("Unknown context.")361 raise UnexpectedFormData("Unknown context.")
296 self.token_context = context362 self.token_context = context
297363
298 def reviewToken(self, permission):364 def reviewToken(self, permission, duration):
299 self.token.review(self.user, permission, self.token_context)365 duration_seconds = TemporaryIntegrations.DURATION.get(duration)
366 if duration_seconds is not None:
367 duration_delta = timedelta(seconds=duration_seconds)
368 expiration_date = (
369 datetime.now(pytz.timezone('UTC')) + duration_delta)
370 else:
371 expiration_date = None
372 self.token.review(self.user, permission, self.token_context,
373 date_expires=expiration_date)
300 callback = self.request.form.get('oauth_callback')374 callback = self.request.form.get('oauth_callback')
301 if callback:375 if callback:
302 self.next_url = callback376 self.next_url = callback
@@ -304,6 +378,7 @@
304 self.next_url = (378 self.next_url = (
305 '+token-authorized?oauth_token=%s' % self.token.key)379 '+token-authorized?oauth_token=%s' % self.token.key)
306380
381
307def lookup_oauth_context(context):382def lookup_oauth_context(context):
308 """Transform an OAuth context string into a context object.383 """Transform an OAuth context string into a context object.
309384
310385
=== modified file 'lib/canonical/launchpad/components/tests/decoratedresultset.txt'
--- lib/canonical/launchpad/components/tests/decoratedresultset.txt 2010-10-09 16:36:22 +0000
+++ lib/canonical/launchpad/components/tests/decoratedresultset.txt 2010-10-21 19:08:55 +0000
@@ -10,8 +10,8 @@
10ResultSet:10ResultSet:
1111
12 >>> from zope.component import getUtility12 >>> from zope.component import getUtility
13 >>> from lp.registry.interfaces.distribution import IDistributionSet
13 >>> from storm.store import Store14 >>> from storm.store import Store
14 >>> from lp.registry.interfaces.distribution import IDistributionSet
15 >>> ubuntu = getUtility(IDistributionSet)['ubuntu']15 >>> ubuntu = getUtility(IDistributionSet)['ubuntu']
16 >>> store = Store.of(ubuntu)16 >>> store = Store.of(ubuntu)
17 >>> from lp.registry.model.distribution import Distribution17 >>> from lp.registry.model.distribution import Distribution
1818
=== modified file 'lib/canonical/launchpad/doc/account.txt'
--- lib/canonical/launchpad/doc/account.txt 2010-10-10 15:39:28 +0000
+++ lib/canonical/launchpad/doc/account.txt 2010-10-21 19:08:55 +0000
@@ -126,8 +126,10 @@
126If we add a new guessed email address, it will be included in the126If we add a new guessed email address, it will be included in the
127guessed list.127guessed list.
128128
129 >>> from canonical.launchpad.interfaces import (129 >>> from canonical.launchpad.interfaces.emailaddress import (
130 ... EmailAddressStatus, IEmailAddressSet)130 ... EmailAddressStatus,
131 ... IEmailAddressSet,
132 ... )
131 >>> email = getUtility(IEmailAddressSet).new(133 >>> email = getUtility(IEmailAddressSet).new(
132 ... "guessed-email@example.com", account=account,134 ... "guessed-email@example.com", account=account,
133 ... status=EmailAddressStatus.NEW)135 ... status=EmailAddressStatus.NEW)
@@ -294,8 +296,8 @@
294296
295 # We need to change database policy here again, as the SSO Server cannot297 # We need to change database policy here again, as the SSO Server cannot
296 # modify tables in the lpmain replication set.298 # modify tables in the lpmain replication set.
299 >>> from canonical.launchpad.webapp.dbpolicy import MasterDatabasePolicy
297 >>> from canonical.launchpad.webapp.interfaces import IStoreSelector300 >>> from canonical.launchpad.webapp.interfaces import IStoreSelector
298 >>> from canonical.launchpad.webapp.dbpolicy import MasterDatabasePolicy
299 >>> getUtility(IStoreSelector).push(MasterDatabasePolicy())301 >>> getUtility(IStoreSelector).push(MasterDatabasePolicy())
300302
301 >>> from lp.registry.interfaces.person import PersonCreationRationale303 >>> from lp.registry.interfaces.person import PersonCreationRationale
302304
=== modified file 'lib/canonical/launchpad/doc/announcement-date-widget.txt'
--- lib/canonical/launchpad/doc/announcement-date-widget.txt 2009-08-13 19:36:01 +0000
+++ lib/canonical/launchpad/doc/announcement-date-widget.txt 2010-10-21 19:08:55 +0000
@@ -4,10 +4,10 @@
4choose to publish an announcement immediately, at a predetermined date in the4choose to publish an announcement immediately, at a predetermined date in the
5future, or to manually publish it later.5future, or to manually publish it later.
66
7 >>> from zope.schema import Field
7 >>> from canonical.launchpad.testing.pages import extract_text8 >>> from canonical.launchpad.testing.pages import extract_text
8 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest9 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
9 >>> from canonical.widgets.announcementdate import AnnouncementDateWidget10 >>> from canonical.widgets.announcementdate import AnnouncementDateWidget
10 >>> from zope.schema import Field
11 >>> field = Field(__name__='foo', title=u'Foo')11 >>> field = Field(__name__='foo', title=u'Foo')
12 >>> widget = AnnouncementDateWidget(field, LaunchpadTestRequest())12 >>> widget = AnnouncementDateWidget(field, LaunchpadTestRequest())
13 >>> print extract_text(widget())13 >>> print extract_text(widget())
1414
=== modified file 'lib/canonical/launchpad/doc/batch_navigation.txt'
--- lib/canonical/launchpad/doc/batch_navigation.txt 2010-10-09 16:36:22 +0000
+++ lib/canonical/launchpad/doc/batch_navigation.txt 2010-10-21 19:08:55 +0000
@@ -55,8 +55,8 @@
5555
56Imports and initialization:56Imports and initialization:
5757
58 >>> from canonical.ftests.pgsql import CursorWrapper
58 >>> from canonical.launchpad.database import EmailAddress59 >>> from canonical.launchpad.database import EmailAddress
59 >>> from canonical.ftests.pgsql import CursorWrapper
60 >>> from canonical.launchpad.interfaces.lpstorm import IStore60 >>> from canonical.launchpad.interfaces.lpstorm import IStore
61 >>> ignore = IStore(EmailAddress) # Prime the database connection.61 >>> ignore = IStore(EmailAddress) # Prime the database connection.
62 ... # (Priming is important if this test is run in isolation).62 ... # (Priming is important if this test is run in isolation).
6363
=== modified file 'lib/canonical/launchpad/doc/canonical_url.txt'
--- lib/canonical/launchpad/doc/canonical_url.txt 2010-10-09 16:36:22 +0000
+++ lib/canonical/launchpad/doc/canonical_url.txt 2010-10-21 19:08:55 +0000
@@ -502,8 +502,8 @@
502502
503 >>> from zope.app.security.principalregistry import (503 >>> from zope.app.security.principalregistry import (
504 ... UnauthenticatedPrincipal)504 ... UnauthenticatedPrincipal)
505 >>> from canonical.launchpad.webapp.interaction import setupInteraction
505 >>> from canonical.launchpad.webapp.servers import WebServiceTestRequest506 >>> from canonical.launchpad.webapp.servers import WebServiceTestRequest
506 >>> from canonical.launchpad.webapp.interaction import setupInteraction
507 >>> from lazr.restful.utils import get_current_browser_request507 >>> from lazr.restful.utils import get_current_browser_request
508 >>> anonymous = UnauthenticatedPrincipal(None, None, None)508 >>> anonymous = UnauthenticatedPrincipal(None, None, None)
509 >>> api_request = WebServiceTestRequest()509 >>> api_request = WebServiceTestRequest()
510510
=== modified file 'lib/canonical/launchpad/doc/canonical_url_examples.txt'
--- lib/canonical/launchpad/doc/canonical_url_examples.txt 2010-10-11 16:17:45 +0000
+++ lib/canonical/launchpad/doc/canonical_url_examples.txt 2010-10-21 19:08:55 +0000
@@ -52,8 +52,11 @@
5252
53== Persons and Teams ==53== Persons and Teams ==
5454
55 >>> from canonical.launchpad.interfaces import (55 >>> from lp.registry.interfaces.codeofconduct import (
56 ... IPersonSet, ICodeOfConductSet, ISignedCodeOfConductSet)56 ... ICodeOfConductSet,
57 ... ISignedCodeOfConductSet,
58 ... )
59 >>> from lp.registry.interfaces.person import IPersonSet
5760
58The IPersonSet.61The IPersonSet.
5962
@@ -133,8 +136,8 @@
133136
134== Projects groups and products ==137== Projects groups and products ==
135138
136 >>> from canonical.launchpad.interfaces import (139 >>> from lp.registry.interfaces.product import IProductSet
137 ... IProjectGroupSet, IProductSet)140 >>> from lp.registry.interfaces.projectgroup import IProjectGroupSet
138141
139The IProjectGroupSet.142The IProjectGroupSet.
140143
@@ -289,8 +292,8 @@
289292
290== Remote Bug Trackers and Remote Bugs ==293== Remote Bug Trackers and Remote Bugs ==
291294
295 >>> from lp.bugs.browser.bugtracker import RemoteBug
292 >>> from lp.bugs.interfaces.bugtracker import IBugTrackerSet296 >>> from lp.bugs.interfaces.bugtracker import IBugTrackerSet
293 >>> from lp.bugs.browser.bugtracker import RemoteBug
294297
295An IBugTrackerSet.298An IBugTrackerSet.
296299
297300
=== modified file 'lib/canonical/launchpad/doc/checkbox-matrix-widget.txt'
--- lib/canonical/launchpad/doc/checkbox-matrix-widget.txt 2010-10-03 15:30:06 +0000
+++ lib/canonical/launchpad/doc/checkbox-matrix-widget.txt 2010-10-21 19:08:55 +0000
@@ -10,8 +10,11 @@
1010
11 >>> from BeautifulSoup import BeautifulSoup11 >>> from BeautifulSoup import BeautifulSoup
12 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest12 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
13 >>> from canonical.launchpad.interfaces import (13 >>> from lp.registry.interfaces.product import (
14 ... IProduct, IProductSet, License)14 ... IProduct,
15 ... IProductSet,
16 ... License,
17 ... )
15 >>> product = getUtility(IProductSet).get(1)18 >>> product = getUtility(IProductSet).get(1)
16 >>> licenses_field = IProduct['licenses'].bind(product)19 >>> licenses_field = IProduct['licenses'].bind(product)
17 >>> vtype = licenses_field.value_type20 >>> vtype = licenses_field.value_type
1821
=== modified file 'lib/canonical/launchpad/doc/emailauthentication.txt'
--- lib/canonical/launchpad/doc/emailauthentication.txt 2010-10-15 15:20:39 +0000
+++ lib/canonical/launchpad/doc/emailauthentication.txt 2010-10-21 19:08:55 +0000
@@ -37,9 +37,9 @@
37user in the launch bag:37user in the launch bag:
3838
39 >>> import email39 >>> import email
40 >>> from zope.component import getUtility
40 >>> from canonical.launchpad.webapp.interfaces import ILaunchBag41 >>> from canonical.launchpad.webapp.interfaces import ILaunchBag
41 >>> from lp.registry.interfaces.person import IPersonSet42 >>> from lp.registry.interfaces.person import IPersonSet
42 >>> from zope.component import getUtility
43 >>> launchbag = getUtility(ILaunchBag)43 >>> launchbag = getUtility(ILaunchBag)
44 >>> name, addr = email.Utils.parseaddr(msg['From'])44 >>> name, addr = email.Utils.parseaddr(msg['From'])
45 >>> from_user = getUtility(IPersonSet).getByEmail(addr)45 >>> from_user = getUtility(IPersonSet).getByEmail(addr)
4646
=== modified file 'lib/canonical/launchpad/doc/feeds.txt'
--- lib/canonical/launchpad/doc/feeds.txt 2009-08-05 18:52:52 +0000
+++ lib/canonical/launchpad/doc/feeds.txt 2010-10-21 19:08:55 +0000
@@ -108,8 +108,8 @@
108by browsers and the reverse-proxy in front of the feeds servers.108by browsers and the reverse-proxy in front of the feeds servers.
109109
110 >>> from canonical.config import config110 >>> from canonical.config import config
111 >>> from canonical.lazr.feed.feed import FeedBase
111 >>> from lp.bugs.feed.bug import BugsFeedBase112 >>> from lp.bugs.feed.bug import BugsFeedBase
112 >>> from canonical.lazr.feed.feed import FeedBase
113 >>> config.launchpad.max_feed_cache_minutes113 >>> config.launchpad.max_feed_cache_minutes
114 60114 60
115 >>> config.launchpad.max_bug_feed_cache_minutes115 >>> config.launchpad.max_bug_feed_cache_minutes
116116
=== modified file 'lib/canonical/launchpad/doc/gpg-encryption.txt'
--- lib/canonical/launchpad/doc/gpg-encryption.txt 2010-10-09 16:36:22 +0000
+++ lib/canonical/launchpad/doc/gpg-encryption.txt 2010-10-21 19:08:55 +0000
@@ -15,8 +15,8 @@
1515
16Sample Person has public and secret keys set.16Sample Person has public and secret keys set.
1717
18 >>> from zope.component import getUtility
18 >>> from canonical.launchpad.ftests import login19 >>> from canonical.launchpad.ftests import login
19 >>> from zope.component import getUtility
20 >>> from canonical.launchpad.webapp.interfaces import ILaunchBag20 >>> from canonical.launchpad.webapp.interfaces import ILaunchBag
2121
22 >>> bag = getUtility(ILaunchBag)22 >>> bag = getUtility(ILaunchBag)
2323
=== modified file 'lib/canonical/launchpad/doc/gpghandler.txt'
--- lib/canonical/launchpad/doc/gpghandler.txt 2010-10-03 15:30:06 +0000
+++ lib/canonical/launchpad/doc/gpghandler.txt 2010-10-21 19:08:55 +0000
@@ -25,8 +25,10 @@
25 >>> from zope.component import getUtility25 >>> from zope.component import getUtility
26 >>> from canonical.launchpad.webapp.testing import verifyObject26 >>> from canonical.launchpad.webapp.testing import verifyObject
2727
28 >>> from canonical.launchpad.interfaces import (28 >>> from canonical.launchpad.interfaces.gpghandler import (
29 ... IGPGHandler, IPymeKey)29 ... IGPGHandler,
30 ... IPymeKey,
31 ... )
30 >>> gpghandler = getUtility(IGPGHandler)32 >>> gpghandler = getUtility(IGPGHandler)
3133
32-------------------------------------------------------------------------34-------------------------------------------------------------------------
3335
=== modified file 'lib/canonical/launchpad/doc/hasowner-authorization.txt'
--- lib/canonical/launchpad/doc/hasowner-authorization.txt 2010-01-12 14:52:41 +0000
+++ lib/canonical/launchpad/doc/hasowner-authorization.txt 2010-10-21 19:08:55 +0000
@@ -5,8 +5,8 @@
55
6 # First we define a class which only provides IHasOwner.6 # First we define a class which only provides IHasOwner.
7 >>> from zope.interface import implements7 >>> from zope.interface import implements
8 >>> from lp.registry.interfaces.person import IPersonSet
8 >>> from lp.registry.interfaces.role import IHasOwner9 >>> from lp.registry.interfaces.role import IHasOwner
9 >>> from lp.registry.interfaces.person import IPersonSet
10 >>> salgado = getUtility(IPersonSet).getByName('salgado')10 >>> salgado = getUtility(IPersonSet).getByName('salgado')
11 >>> class FooObject:11 >>> class FooObject:
12 ... implements(IHasOwner)12 ... implements(IHasOwner)
@@ -15,8 +15,8 @@
15Salgado is the owner of any FooObject we create, so he can edit it.15Salgado is the owner of any FooObject we create, so he can edit it.
1616
17 >>> foo = FooObject()17 >>> foo = FooObject()
18 >>> from zope.component import queryAdapter
18 >>> from canonical.launchpad.webapp.interfaces import IAuthorization19 >>> from canonical.launchpad.webapp.interfaces import IAuthorization
19 >>> from zope.component import queryAdapter
20 >>> authorization = queryAdapter(foo, IAuthorization, 'launchpad.Edit')20 >>> authorization = queryAdapter(foo, IAuthorization, 'launchpad.Edit')
21 >>> print authorization.checkAccountAuthenticated(salgado.account)21 >>> print authorization.checkAccountAuthenticated(salgado.account)
22 True22 True
2323
=== modified file 'lib/canonical/launchpad/doc/hierarchical-menu.txt'
--- lib/canonical/launchpad/doc/hierarchical-menu.txt 2010-07-27 12:42:00 +0000
+++ lib/canonical/launchpad/doc/hierarchical-menu.txt 2010-10-21 19:08:55 +0000
@@ -22,8 +22,8 @@
22 >>> class ICooker(Interface):22 >>> class ICooker(Interface):
23 ... """A cooker."""23 ... """A cooker."""
2424
25 >>> from canonical.launchpad.webapp.interfaces import ICanonicalUrlData
25 >>> from canonical.launchpad.webapp.url import urlappend26 >>> from canonical.launchpad.webapp.url import urlappend
26 >>> from canonical.launchpad.webapp.interfaces import ICanonicalUrlData
2727
28 >>> class BaseContent:28 >>> class BaseContent:
29 ... implements(ICanonicalUrlData)29 ... implements(ICanonicalUrlData)
@@ -83,8 +83,8 @@
83IBreadcrumb adapters are registered for them. The hierarchy builds a list of83IBreadcrumb adapters are registered for them. The hierarchy builds a list of
84breadcrumbs starting with the breadcrumb closest to the hierarchy root.84breadcrumbs starting with the breadcrumb closest to the hierarchy root.
8585
86 >>> from canonical.launchpad.browser.launchpad import Hierarchy
86 >>> from canonical.launchpad.webapp.breadcrumb import Breadcrumb87 >>> from canonical.launchpad.webapp.breadcrumb import Breadcrumb
87 >>> from canonical.launchpad.browser.launchpad import Hierarchy
8888
89 # Monkey patch Hierarchy.makeBreadcrumbForRequestedPage so that we don't89 # Monkey patch Hierarchy.makeBreadcrumbForRequestedPage so that we don't
90 # have to create fake views and other stuff to test breadcrumbs here. The90 # have to create fake views and other stuff to test breadcrumbs here. The
@@ -174,8 +174,8 @@
174context. The default adapter provides the url attribute, but the breadcrumb's174context. The default adapter provides the url attribute, but the breadcrumb's
175text must be overriden in subclasses.175text must be overriden in subclasses.
176176
177 >>> from canonical.launchpad.webapp.interfaces import IBreadcrumb
178 >>> from zope.interface.verify import verifyObject177 >>> from zope.interface.verify import verifyObject
178 >>> from canonical.launchpad.webapp.interfaces import IBreadcrumb
179 >>> breadcrumb = Breadcrumb(cookbook)179 >>> breadcrumb = Breadcrumb(cookbook)
180 >>> verifyObject(IBreadcrumb, breadcrumb)180 >>> verifyObject(IBreadcrumb, breadcrumb)
181 True181 True
182182
=== modified file 'lib/canonical/launchpad/doc/launchpad-container.txt'
--- lib/canonical/launchpad/doc/launchpad-container.txt 2009-06-12 16:36:02 +0000
+++ lib/canonical/launchpad/doc/launchpad-container.txt 2010-10-21 19:08:55 +0000
@@ -7,8 +7,8 @@
7that we have an easy way of finding whether or not any given object is7that we have an easy way of finding whether or not any given object is
8within the scope of a token's context and grant or deny access to it.8within the scope of a token's context and grant or deny access to it.
99
10 >>> from canonical.launchpad.webapp.interfaces import ILaunchpadContainer
10 >>> from canonical.launchpad.webapp.testing import verifyObject11 >>> from canonical.launchpad.webapp.testing import verifyObject
11 >>> from canonical.launchpad.webapp.interfaces import ILaunchpadContainer
12 >>> from lp.registry.interfaces.product import IProductSet12 >>> from lp.registry.interfaces.product import IProductSet
13 >>> from lp.registry.interfaces.distribution import (13 >>> from lp.registry.interfaces.distribution import (
14 ... IDistributionSet)14 ... IDistributionSet)
@@ -80,8 +80,8 @@
80Bugs are associated to our pillars through their bug tasks, so a bug is80Bugs are associated to our pillars through their bug tasks, so a bug is
81said to be within any of its bugtasks' targets.81said to be within any of its bugtasks' targets.
8282
83 >>> from lp.bugs.interfaces.bug import IBugSet
83 >>> from operator import attrgetter84 >>> from operator import attrgetter
84 >>> from lp.bugs.interfaces.bug import IBugSet
85 >>> bug_1 = getUtility(IBugSet).get(1)85 >>> bug_1 = getUtility(IBugSet).get(1)
86 >>> bugtasks = bug_1.bugtasks86 >>> bugtasks = bug_1.bugtasks
87 >>> targets = [task.target for task in bug_1.bugtasks]87 >>> targets = [task.target for task in bug_1.bugtasks]
8888
=== modified file 'lib/canonical/launchpad/doc/launchpad-target-widget.txt'
--- lib/canonical/launchpad/doc/launchpad-target-widget.txt 2010-10-09 16:36:22 +0000
+++ lib/canonical/launchpad/doc/launchpad-target-widget.txt 2010-10-21 19:08:55 +0000
@@ -3,10 +3,10 @@
3The general +filebug allows bugs to be filed on any product or package,3The general +filebug allows bugs to be filed on any product or package,
4and to help with this, the LaunchpadTargetWidget is used.4and to help with this, the LaunchpadTargetWidget is used.
55
6 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
6 >>> from canonical.launchpad.webapp.testing import verifyObject7 >>> from canonical.launchpad.webapp.testing import verifyObject
8 >>> from canonical.widgets.launchpadtarget import LaunchpadTargetWidget
7 >>> from lp.bugs.interfaces.bug import IFrontPageBugAddForm9 >>> from lp.bugs.interfaces.bug import IFrontPageBugAddForm
8 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
9 >>> from canonical.widgets.launchpadtarget import LaunchpadTargetWidget
1010
11 >>> empty_request = LaunchpadTestRequest()11 >>> empty_request = LaunchpadTestRequest()
12 >>> widget = LaunchpadTargetWidget(12 >>> widget = LaunchpadTargetWidget(
@@ -14,8 +14,8 @@
1414
15The widget complies to both IInputWidget and IBrowserWidget.15The widget complies to both IInputWidget and IBrowserWidget.
1616
17 >>> from zope.app.form.browser.interfaces import IBrowserWidget
17 >>> from zope.app.form.interfaces import IInputWidget18 >>> from zope.app.form.interfaces import IInputWidget
18 >>> from zope.app.form.browser.interfaces import IBrowserWidget
19 >>> verifyObject(IInputWidget, widget)19 >>> verifyObject(IInputWidget, widget)
20 True20 True
21 >>> verifyObject(IBrowserWidget, widget)21 >>> verifyObject(IBrowserWidget, widget)
2222
=== modified file 'lib/canonical/launchpad/doc/launchpadform.txt'
--- lib/canonical/launchpad/doc/launchpadform.txt 2009-06-12 16:36:02 +0000
+++ lib/canonical/launchpad/doc/launchpadform.txt 2010-10-21 19:08:55 +0000
@@ -131,8 +131,8 @@
131attribute:131attribute:
132132
133 >>> from zope.app.form.browser import TextWidget133 >>> from zope.app.form.browser import TextWidget
134 >>> from canonical.launchpad.webapp import custom_widget
134 >>> from canonical.widgets import PasswordChangeWidget135 >>> from canonical.widgets import PasswordChangeWidget
135 >>> from canonical.launchpad.webapp import custom_widget
136136
137 >>> class FormTestView3(LaunchpadFormView):137 >>> class FormTestView3(LaunchpadFormView):
138 ... schema = IFormTest138 ... schema = IFormTest
@@ -469,9 +469,9 @@
469First we'll create a fake pagetemplate which doesn't use Launchpad's main469First we'll create a fake pagetemplate which doesn't use Launchpad's main
470template and thus is way simpler.470template and thus is way simpler.
471471
472 >>> from z3c.ptcompat import ViewPageTemplateFile
473 >>> from StringIO import StringIO472 >>> from StringIO import StringIO
474 >>> from tempfile import mkstemp473 >>> from tempfile import mkstemp
474 >>> from z3c.ptcompat import ViewPageTemplateFile
475 >>> file, filename = mkstemp()475 >>> file, filename = mkstemp()
476 >>> f = open(filename, 'w')476 >>> f = open(filename, 'w')
477 >>> f.write(u'<div metal:use-macro="context/@@launchpad_form/form" />')477 >>> f.write(u'<div metal:use-macro="context/@@launchpad_form/form" />')
478478
=== modified file 'lib/canonical/launchpad/doc/lazr-js-widgets.txt'
--- lib/canonical/launchpad/doc/lazr-js-widgets.txt 2010-10-09 16:36:22 +0000
+++ lib/canonical/launchpad/doc/lazr-js-widgets.txt 2010-10-21 19:08:55 +0000
@@ -82,8 +82,8 @@
82The InlineEditPickerWidget can be used for any interface attribute that82The InlineEditPickerWidget can be used for any interface attribute that
83has a vocabulary defined for it.83has a vocabulary defined for it.
8484
85 >>> from zope.component import getUtility
85 >>> from canonical.widgets.lazrjs import InlineEditPickerWidget86 >>> from canonical.widgets.lazrjs import InlineEditPickerWidget
86 >>> from zope.component import getUtility
87 >>> from lp.bugs.interfaces.bugtask import IBugTask, IBugTaskSet87 >>> from lp.bugs.interfaces.bugtask import IBugTask, IBugTaskSet
88 >>> bugtask = getUtility(IBugTaskSet).get(2)88 >>> bugtask = getUtility(IBugTaskSet).get(2)
89 >>> def create_inline_edit_picker_widget():89 >>> def create_inline_edit_picker_widget():
9090
=== modified file 'lib/canonical/launchpad/doc/librarian.txt'
--- lib/canonical/launchpad/doc/librarian.txt 2010-10-10 15:39:28 +0000
+++ lib/canonical/launchpad/doc/librarian.txt 2010-10-21 19:08:55 +0000
@@ -28,8 +28,8 @@
2828
29== High Level ==29== High Level ==
3030
31 >>> from StringIO import StringIO
31 >>> from canonical.launchpad.interfaces.librarian import ILibraryFileAliasSet32 >>> from canonical.launchpad.interfaces.librarian import ILibraryFileAliasSet
32 >>> from StringIO import StringIO
33 >>> data = 'This is some data'33 >>> data = 'This is some data'
3434
35We can create LibraryFileAliases using the ILibraryFileAliasSet utility.35We can create LibraryFileAliases using the ILibraryFileAliasSet utility.
@@ -118,8 +118,8 @@
118However, we can force the use of HTTP by setting the 'HTTP_X_SCHEME'118However, we can force the use of HTTP by setting the 'HTTP_X_SCHEME'
119header in the request to 'http', even when 'use_https' is True.119header in the request to 'http', even when 'use_https' is True.
120120
121 >>> from zope.component import getMultiAdapter
121 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest122 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
122 >>> from zope.component import getMultiAdapter
123 >>> from urlparse import urlparse123 >>> from urlparse import urlparse
124 >>> request = LaunchpadTestRequest(124 >>> request = LaunchpadTestRequest(
125 ... environ={'REQUEST_METHOD': 'GET',125 ... environ={'REQUEST_METHOD': 'GET',
@@ -573,9 +573,9 @@
573573
574XXX bug=631884 we have to establish the flags object manually for testing.574XXX bug=631884 we have to establish the flags object manually for testing.
575575
576 >>> from lp.services.features import per_thread
577 >>> from lp.services.features.flags import FeatureController
576 >>> from lp.services.features.webapp import ScopesFromRequest578 >>> from lp.services.features.webapp import ScopesFromRequest
577 >>> from lp.services.features.flags import FeatureController
578 >>> from lp.services.features import per_thread
579 >>> per_thread.features = FeatureController(579 >>> per_thread.features = FeatureController(
580 ... ScopesFromRequest(empty_request).lookup)580 ... ScopesFromRequest(empty_request).lookup)
581581
582582
=== modified file 'lib/canonical/launchpad/doc/location-widget.txt'
--- lib/canonical/launchpad/doc/location-widget.txt 2010-09-21 04:21:16 +0000
+++ lib/canonical/launchpad/doc/location-widget.txt 2010-10-21 19:08:55 +0000
@@ -3,9 +3,9 @@
3A widget used when setting the geographic location of a given person.3A widget used when setting the geographic location of a given person.
44
5 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest5 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
6 >>> from canonical.widgets.location import LocationWidget
6 >>> from lp.registry.interfaces.person import IPersonSet7 >>> from lp.registry.interfaces.person import IPersonSet
7 >>> from lp.services.fields import LocationField8 >>> from lp.services.fields import LocationField
8 >>> from canonical.widgets.location import LocationWidget
9 >>> salgado = getUtility(IPersonSet).getByName('salgado')9 >>> salgado = getUtility(IPersonSet).getByName('salgado')
10 >>> field = LocationField(__name__='location', title=u'Location')10 >>> field = LocationField(__name__='location', title=u'Location')
1111
1212
=== modified file 'lib/canonical/launchpad/doc/logintoken-pages.txt'
--- lib/canonical/launchpad/doc/logintoken-pages.txt 2010-10-03 15:30:06 +0000
+++ lib/canonical/launchpad/doc/logintoken-pages.txt 2010-10-21 19:08:55 +0000
@@ -21,8 +21,8 @@
21 >>> from canonical.launchpad.interfaces.authtoken import LoginTokenType21 >>> from canonical.launchpad.interfaces.authtoken import LoginTokenType
22 >>> from canonical.launchpad.interfaces.logintoken import (22 >>> from canonical.launchpad.interfaces.logintoken import (
23 ... ILoginTokenSet)23 ... ILoginTokenSet)
24 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
24 >>> from lp.registry.model.person import PersonSet25 >>> from lp.registry.model.person import PersonSet
25 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
2626
27 # To simplify our tests we'll use the PersonSet() class directly instead27 # To simplify our tests we'll use the PersonSet() class directly instead
28 # of gettint it as a zope secured utility. If we don't do that we'd have28 # of gettint it as a zope secured utility. If we don't do that we'd have
2929
=== modified file 'lib/canonical/launchpad/doc/logintoken.txt'
--- lib/canonical/launchpad/doc/logintoken.txt 2009-05-12 01:39:29 +0000
+++ lib/canonical/launchpad/doc/logintoken.txt 2010-10-21 19:08:55 +0000
@@ -18,12 +18,12 @@
18 4) The token is now marked as consumed, together with any other18 4) The token is now marked as consumed, together with any other
19 tokens of the same type and for the same email address.19 tokens of the same type and for the same email address.
2020
21 >>> from canonical.launchpad.interfaces.authtoken import LoginTokenType
21 >>> from lp.registry.model.person import Person22 >>> from lp.registry.model.person import Person
22 >>> from canonical.launchpad.interfaces.authtoken import LoginTokenType
23 >>> from canonical.launchpad.interfaces.logintoken import (23 >>> from canonical.launchpad.interfaces.logintoken import (
24 ... ILoginTokenSet)24 ... ILoginTokenSet)
25 >>> from canonical.database.sqlbase import flush_database_updates
25 >>> from lp.services.mail import stub26 >>> from lp.services.mail import stub
26 >>> from canonical.database.sqlbase import flush_database_updates
27 >>> import transaction27 >>> import transaction
28 >>> foobar = Person.byName('name16')28 >>> foobar = Person.byName('name16')
2929
@@ -96,8 +96,8 @@
96our own making.96our own making.
9797
98 >>> import pytz98 >>> import pytz
99 >>> from zope.security.proxy import removeSecurityProxy
99 >>> from datetime import datetime100 >>> from datetime import datetime
100 >>> from zope.security.proxy import removeSecurityProxy
101101
102 >>> token = removeSecurityProxy(token)102 >>> token = removeSecurityProxy(token)
103 >>> token.date_consumed = datetime(103 >>> token.date_consumed = datetime(
104104
=== modified file 'lib/canonical/launchpad/doc/looptuner.txt'
--- lib/canonical/launchpad/doc/looptuner.txt 2010-04-07 15:57:55 +0000
+++ lib/canonical/launchpad/doc/looptuner.txt 2010-10-21 19:08:55 +0000
@@ -20,8 +20,8 @@
2020
21 >>> import math21 >>> import math
22 >>> from zope.interface import implements22 >>> from zope.interface import implements
23 >>> from canonical.launchpad.interfaces.looptuner import ITunableLoop
23 >>> from canonical.launchpad.utilities.looptuner import LoopTuner24 >>> from canonical.launchpad.utilities.looptuner import LoopTuner
24 >>> from canonical.launchpad.interfaces.looptuner import ITunableLoop
2525
26The LoopTuner requires the operation you define for it to implement the26The LoopTuner requires the operation you define for it to implement the
27ITunableLoop interface.27ITunableLoop interface.
2828
=== modified file 'lib/canonical/launchpad/doc/lower-case-text-widget.txt'
--- lib/canonical/launchpad/doc/lower-case-text-widget.txt 2010-10-09 16:36:22 +0000
+++ lib/canonical/launchpad/doc/lower-case-text-widget.txt 2010-10-21 19:08:55 +0000
@@ -7,9 +7,9 @@
7LowerCaseTextWidget can be used to automatically convert the input to7LowerCaseTextWidget can be used to automatically convert the input to
8lower case:8lower case:
99
10 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
11 >>> from canonical.widgets.textwidgets import LowerCaseTextWidget
10 >>> from lp.bugs.interfaces.bug import IBug12 >>> from lp.bugs.interfaces.bug import IBug
11 >>> from canonical.widgets.textwidgets import LowerCaseTextWidget
12 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
13 >>> field = IBug['description']13 >>> field = IBug['description']
14 >>> request = LaunchpadTestRequest(form={'field.description':'Foo'})14 >>> request = LaunchpadTestRequest(form={'field.description':'Foo'})
15 >>> widget = LowerCaseTextWidget(field, request)15 >>> widget = LowerCaseTextWidget(field, request)
1616
=== modified file 'lib/canonical/launchpad/doc/menus.txt'
--- lib/canonical/launchpad/doc/menus.txt 2009-10-21 17:41:20 +0000
+++ lib/canonical/launchpad/doc/menus.txt 2010-10-21 19:08:55 +0000
@@ -341,8 +341,8 @@
341 # We need to use a real launchpad test request so the view adapter341 # We need to use a real launchpad test request so the view adapter
342 # lookups will work. That request also needs to implement342 # lookups will work. That request also needs to implement
343 # IParticipation so that the login machinery will work.343 # IParticipation so that the login machinery will work.
344 >>> from zope.security.interfaces import IParticipation
344 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest345 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
345 >>> from zope.security.interfaces import IParticipation
346 >>> class InteractiveTestRequest(LaunchpadTestRequest):346 >>> class InteractiveTestRequest(LaunchpadTestRequest):
347 ... implements(IParticipation)347 ... implements(IParticipation)
348 ... principal = None348 ... principal = None
@@ -687,10 +687,10 @@
687link should appear linked. The request is also set as the menu's687link should appear linked. The request is also set as the menu's
688'request' attribute.688'request' attribute.
689689
690 >>> from zope.publisher.interfaces.browser import IBrowserRequest
691 >>> from zope.publisher.interfaces.http import IHTTPApplicationRequest
690 >>> from canonical.launchpad.ftests import test_tales692 >>> from canonical.launchpad.ftests import test_tales
691 >>> from canonical.launchpad.webapp import LaunchpadView693 >>> from canonical.launchpad.webapp import LaunchpadView
692 >>> from zope.publisher.interfaces.http import IHTTPApplicationRequest
693 >>> from zope.publisher.interfaces.browser import IBrowserRequest
694 >>> from canonical.launchpad.webapp.vhosts import allvhosts694 >>> from canonical.launchpad.webapp.vhosts import allvhosts
695 >>> class FakeRequest:695 >>> class FakeRequest:
696 ... implements(IHTTPApplicationRequest, IBrowserRequest)696 ... implements(IHTTPApplicationRequest, IBrowserRequest)
697697
=== modified file 'lib/canonical/launchpad/doc/message.txt'
--- lib/canonical/launchpad/doc/message.txt 2010-10-09 16:36:22 +0000
+++ lib/canonical/launchpad/doc/message.txt 2010-10-21 19:08:55 +0000
@@ -4,8 +4,9 @@
4various parts of launchpad. Currently, it is used by Malone for comments4various parts of launchpad. Currently, it is used by Malone for comments
5on bugs. Bugs are linked to Messages via the BugMessage table.5on bugs. Bugs are linked to Messages via the BugMessage table.
66
7 >>> from canonical.launchpad.interfaces import (7 >>> from canonical.launchpad.webapp.interfaces import IOpenLaunchBag
8 ... IBugMessageSet, IBugSet, IOpenLaunchBag)8 >>> from lp.bugs.interfaces.bug import IBugSet
9 >>> from lp.bugs.interfaces.bugmessage import IBugMessageSet
9 >>> login('foo.bar@canonical.com')10 >>> login('foo.bar@canonical.com')
10 >>> bugmessageset = getUtility(IBugMessageSet)11 >>> bugmessageset = getUtility(IBugMessageSet)
11 >>> bug_one = getUtility(IBugSet).get(1)12 >>> bug_one = getUtility(IBugSet).get(1)
1213
=== modified file 'lib/canonical/launchpad/doc/navigation.txt'
--- lib/canonical/launchpad/doc/navigation.txt 2010-10-03 15:30:06 +0000
+++ lib/canonical/launchpad/doc/navigation.txt 2010-10-21 19:08:55 +0000
@@ -269,8 +269,8 @@
269Once registered, we can look the navigation up using getMultiAdapter().269Once registered, we can look the navigation up using getMultiAdapter().
270270
271 >>> from zope.component import getMultiAdapter271 >>> from zope.component import getMultiAdapter
272 >>> from zope.publisher.interfaces.browser import IBrowserPublisher
272 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest273 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
273 >>> from zope.publisher.interfaces.browser import IBrowserPublisher
274 >>> navigation = getMultiAdapter(274 >>> navigation = getMultiAdapter(
275 ... (thingset, LaunchpadTestRequest()), IBrowserPublisher, name='')275 ... (thingset, LaunchpadTestRequest()), IBrowserPublisher, name='')
276276
277277
=== modified file 'lib/canonical/launchpad/doc/new-line-to-spaces-widget.txt'
--- lib/canonical/launchpad/doc/new-line-to-spaces-widget.txt 2010-10-09 16:36:22 +0000
+++ lib/canonical/launchpad/doc/new-line-to-spaces-widget.txt 2010-10-21 19:08:55 +0000
@@ -3,8 +3,8 @@
33
4This custom widget is used to replace new line characters to spaces.4This custom widget is used to replace new line characters to spaces.
55
6 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
6 >>> from canonical.widgets.bugtask import NewLineToSpacesWidget7 >>> from canonical.widgets.bugtask import NewLineToSpacesWidget
7 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
8 >>> from lp.bugs.interfaces.bugtask import IBugTaskSearch8 >>> from lp.bugs.interfaces.bugtask import IBugTaskSearch
99
10We pass a string with some new line characters to the widget10We pass a string with some new line characters to the widget
1111
=== modified file 'lib/canonical/launchpad/doc/notification-recipient-set.txt'
--- lib/canonical/launchpad/doc/notification-recipient-set.txt 2010-10-09 16:36:22 +0000
+++ lib/canonical/launchpad/doc/notification-recipient-set.txt 2010-10-21 19:08:55 +0000
@@ -15,8 +15,8 @@
15You can use it as is or derive from it15You can use it as is or derive from it
16(see bugnotificationrecipients.txt for an example of a derivation).16(see bugnotificationrecipients.txt for an example of a derivation).
1717
18 >>> from canonical.launchpad.interfaces.launchpad import INotificationRecipientSet
18 >>> from canonical.launchpad.webapp.testing import verifyObject19 >>> from canonical.launchpad.webapp.testing import verifyObject
19 >>> from canonical.launchpad.interfaces.launchpad import INotificationRecipientSet
20 >>> from canonical.launchpad.mailnotification import (20 >>> from canonical.launchpad.mailnotification import (
21 ... NotificationRecipientSet)21 ... NotificationRecipientSet)
2222
2323
=== modified file 'lib/canonical/launchpad/doc/notification-text-escape.txt'
--- lib/canonical/launchpad/doc/notification-text-escape.txt 2008-04-16 16:28:14 +0000
+++ lib/canonical/launchpad/doc/notification-text-escape.txt 2010-10-21 19:08:55 +0000
@@ -41,8 +41,8 @@
41IStructuredString interface, then a string will be returned with the41IStructuredString interface, then a string will be returned with the
42appropriate sections escaped and unescaped.42appropriate sections escaped and unescaped.
4343
44 >>> from canonical.launchpad.webapp.interfaces import IStructuredString
44 >>> from canonical.launchpad.webapp.menu import structured45 >>> from canonical.launchpad.webapp.menu import structured
45 >>> from canonical.launchpad.webapp.interfaces import IStructuredString
46 >>> msg = u'<b>%(escaped)s</b>'46 >>> msg = u'<b>%(escaped)s</b>'
47 >>> structured_text = structured(msg, escaped=u'<br/>foo')47 >>> structured_text = structured(msg, escaped=u'<br/>foo')
48 >>> IStructuredString.providedBy(structured_text)48 >>> IStructuredString.providedBy(structured_text)
4949
=== modified file 'lib/canonical/launchpad/doc/oauth-pages.txt'
--- lib/canonical/launchpad/doc/oauth-pages.txt 2009-06-12 16:36:02 +0000
+++ lib/canonical/launchpad/doc/oauth-pages.txt 2010-10-21 19:08:55 +0000
@@ -32,6 +32,28 @@
32 ... if tag.attrMap['value']:32 ... if tag.attrMap['value']:
33 ... print tag.attrMap['name'], tag.attrMap['value']33 ... print tag.attrMap['name'], tag.attrMap['value']
3434
35When the client doesn't specify a duration, the resulting request
36token will have no expiration date set.
37
38 >>> from datetime import datetime
39 >>> view, token = get_view_with_fresh_token({})
40 >>> view.reviewToken(OAuthPermission.READ_PRIVATE, None)
41 >>> print token.date_expires
42 None
43
44When the client specifies a duration, the resulting request
45token will have an appropriate expiration date set.
46
47 >>> from datetime import datetime
48 >>> import pytz
49 >>> from canonical.launchpad.browser.oauth import (
50 ... TemporaryIntegrations)
51 >>> view, token = get_view_with_fresh_token({})
52 >>> view.reviewToken(
53 ... OAuthPermission.READ_PRIVATE, TemporaryIntegrations.HOUR)
54 >>> token.date_expires > datetime.now(pytz.timezone('UTC'))
55 True
56
35When the consumer doesn't specify a context, the token will not have a57When the consumer doesn't specify a context, the token will not have a
36context either.58context either.
3759
@@ -45,7 +67,7 @@
45 loggingout...67 loggingout...
46 oauth_token...68 oauth_token...
4769
48 >>> view.reviewToken(OAuthPermission.READ_PRIVATE)70 >>> view.reviewToken(OAuthPermission.READ_PRIVATE, None)
49 >>> token.person.name71 >>> token.person.name
50 u'salgado'72 u'salgado'
51 >>> print token.context73 >>> print token.context
@@ -69,7 +91,7 @@
69 oauth_token...91 oauth_token...
70 lp.context firefox92 lp.context firefox
7193
72 >>> view.reviewToken(OAuthPermission.READ_PUBLIC)94 >>> view.reviewToken(OAuthPermission.READ_PUBLIC, None)
73 >>> token.context.name95 >>> token.context.name
74 u'firefox'96 u'firefox'
7597
@@ -86,7 +108,7 @@
86 oauth_token...108 oauth_token...
87 lp.context mozilla109 lp.context mozilla
88110
89 >>> view.reviewToken(OAuthPermission.READ_PUBLIC)111 >>> view.reviewToken(OAuthPermission.READ_PUBLIC, None)
90 >>> token.context.name112 >>> token.context.name
91 u'mozilla'113 u'mozilla'
92114
@@ -103,7 +125,7 @@
103 oauth_token...125 oauth_token...
104 lp.context ubuntu126 lp.context ubuntu
105127
106 >>> view.reviewToken(OAuthPermission.READ_PUBLIC)128 >>> view.reviewToken(OAuthPermission.READ_PUBLIC, None)
107 >>> token.context.name129 >>> token.context.name
108 u'ubuntu'130 u'ubuntu'
109131
@@ -122,7 +144,7 @@
122 oauth_token...144 oauth_token...
123 lp.context ubuntu/evolution145 lp.context ubuntu/evolution
124146
125 >>> view.reviewToken(OAuthPermission.READ_PUBLIC)147 >>> view.reviewToken(OAuthPermission.READ_PUBLIC, None)
126 >>> token.context.title148 >>> token.context.title
127 u'...evolution... package in Ubuntu'149 u'...evolution... package in Ubuntu'
128150
129151
=== modified file 'lib/canonical/launchpad/doc/oauth.txt'
--- lib/canonical/launchpad/doc/oauth.txt 2010-10-21 19:08:53 +0000
+++ lib/canonical/launchpad/doc/oauth.txt 2010-10-21 19:08:55 +0000
@@ -17,8 +17,13 @@
1717
18Here's a quick demonstration of the behavior.18Here's a quick demonstration of the behavior.
1919
20 >>> login('foo.bar@canonical.com')
21 >>> access_token = factory.makeOAuthAccessToken()
22 >>> logout()
23
20- We can use a nonce.24- We can use a nonce.
2125
26 >>> from canonical.launchpad.interfaces.oauth import IOAuthNonce
22 >>> import time27 >>> import time
23 >>> now = time.time() - 128 >>> now = time.time() - 1
24 >>> nonce1 = access_token.checkNonceAndTimestamp('boo', now)29 >>> nonce1 = access_token.checkNonceAndTimestamp('boo', now)
2530
=== modified file 'lib/canonical/launchpad/doc/object-privacy.txt'
--- lib/canonical/launchpad/doc/object-privacy.txt 2010-10-03 15:30:06 +0000
+++ lib/canonical/launchpad/doc/object-privacy.txt 2010-10-21 19:08:55 +0000
@@ -8,8 +8,9 @@
8IObjectPrivacy and check its is_private attribute.8IObjectPrivacy and check its is_private attribute.
99
10 >>> from canonical.lazr.interfaces import IObjectPrivacy10 >>> from canonical.lazr.interfaces import IObjectPrivacy
11 >>> from canonical.launchpad.interfaces import (11 >>> from lp.answers.interfaces.questioncollection import IQuestionSet
12 ... IBugSet, IPersonSet, IQuestionSet)12 >>> from lp.bugs.interfaces.bug import IBugSet
13 >>> from lp.registry.interfaces.person import IPersonSet
13 >>> bug = getUtility(IBugSet).get(1)14 >>> bug = getUtility(IBugSet).get(1)
14 >>> bug.private15 >>> bug.private
15 False16 False
1617
=== modified file 'lib/canonical/launchpad/doc/package-relationship.txt'
--- lib/canonical/launchpad/doc/package-relationship.txt 2010-10-09 16:36:22 +0000
+++ lib/canonical/launchpad/doc/package-relationship.txt 2010-10-21 19:08:55 +0000
@@ -54,8 +54,8 @@
54Now for each parsed element we can build an IPackageRelationship:54Now for each parsed element we can build an IPackageRelationship:
5555
56 >>> from canonical.launchpad.browser import PackageRelationship56 >>> from canonical.launchpad.browser import PackageRelationship
57 >>> from canonical.launchpad.interfaces.packagerelationship import IPackageRelationship
57 >>> from canonical.launchpad.webapp.testing import verifyObject58 >>> from canonical.launchpad.webapp.testing import verifyObject
58 >>> from canonical.launchpad.interfaces.packagerelationship import IPackageRelationship
5959
60 >>> name, version, operator = parsed_relationships[1]60 >>> name, version, operator = parsed_relationships[1]
61 >>> fake_url = 'http://host/path'61 >>> fake_url = 'http://host/path'
6262
=== modified file 'lib/canonical/launchpad/doc/presenting-lengths-of-time.txt'
--- lib/canonical/launchpad/doc/presenting-lengths-of-time.txt 2005-10-31 18:29:12 +0000
+++ lib/canonical/launchpad/doc/presenting-lengths-of-time.txt 2010-10-21 19:08:55 +0000
@@ -3,8 +3,8 @@
33
4First, let's bring in some dependencies:4First, let's bring in some dependencies:
55
6 >>> from canonical.launchpad.ftests import test_tales
6 >>> from datetime import timedelta7 >>> from datetime import timedelta
7 >>> from canonical.launchpad.ftests import test_tales
88
9Exact Duration9Exact Duration
10--------------10--------------
1111
=== modified file 'lib/canonical/launchpad/doc/project-scope-widget.txt'
--- lib/canonical/launchpad/doc/project-scope-widget.txt 2010-10-09 16:36:22 +0000
+++ lib/canonical/launchpad/doc/project-scope-widget.txt 2010-10-21 19:08:55 +0000
@@ -7,9 +7,9 @@
7we will use the Project vocabulary which allows any project to be7we will use the Project vocabulary which allows any project to be
8selected.8selected.
99
10 >>> from canonical.launchpad.webapp.testing import verifyObject
11 >>> from zope.schema import Choice10 >>> from zope.schema import Choice
12 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest11 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
12 >>> from canonical.launchpad.webapp.testing import verifyObject
13 >>> from canonical.widgets.project import ProjectScopeWidget13 >>> from canonical.widgets.project import ProjectScopeWidget
1414
15 >>> empty_request = LaunchpadTestRequest()15 >>> empty_request = LaunchpadTestRequest()
@@ -21,8 +21,8 @@
2121
22The widget complies to both IInputWidget and IBrowserWidget.22The widget complies to both IInputWidget and IBrowserWidget.
2323
24 >>> from zope.app.form.browser.interfaces import IBrowserWidget
24 >>> from zope.app.form.interfaces import IInputWidget25 >>> from zope.app.form.interfaces import IInputWidget
25 >>> from zope.app.form.browser.interfaces import IBrowserWidget
26 >>> verifyObject(IInputWidget, widget)26 >>> verifyObject(IInputWidget, widget)
27 True27 True
28 >>> verifyObject(IBrowserWidget, widget)28 >>> verifyObject(IBrowserWidget, widget)
2929
=== modified file 'lib/canonical/launchpad/doc/security-proxies.txt'
--- lib/canonical/launchpad/doc/security-proxies.txt 2010-10-17 02:00:18 +0000
+++ lib/canonical/launchpad/doc/security-proxies.txt 2010-10-21 19:08:55 +0000
@@ -45,8 +45,8 @@
45XXX: bug 331545XXX: bug 3315
46DB schema objects should be comparable correctly when proxied...46DB schema objects should be comparable correctly when proxied...
4747
48 >>> from canonical.launchpad.interfaces import (48 >>> from lp.registry.interfaces.distroseries import IDistroSeriesSet
49 ... SeriesStatus, IDistroSeriesSet)49 >>> from lp.registry.interfaces.series import SeriesStatus
50 >>> hoary = getUtility(IDistroSeriesSet).get(3)50 >>> hoary = getUtility(IDistroSeriesSet).get(3)
51 >>> print hoary.status.name51 >>> print hoary.status.name
52 DEVELOPMENT52 DEVELOPMENT
5353
=== modified file 'lib/canonical/launchpad/doc/signedmessage.txt'
--- lib/canonical/launchpad/doc/signedmessage.txt 2007-08-09 14:49:07 +0000
+++ lib/canonical/launchpad/doc/signedmessage.txt 2010-10-21 19:08:55 +0000
@@ -6,9 +6,9 @@
6SignedMessage as the _class parameter, but it also ensures that all6SignedMessage as the _class parameter, but it also ensures that all
7the attributes are correctly set.7the attributes are correctly set.
88
9 >>> from canonical.launchpad.interfaces.mail import ISignedMessage
10 >>> from canonical.launchpad.mail import signed_message_from_string
9 >>> from canonical.launchpad.webapp.testing import verifyObject11 >>> from canonical.launchpad.webapp.testing import verifyObject
10 >>> from canonical.launchpad.mail import signed_message_from_string
11 >>> from canonical.launchpad.interfaces.mail import ISignedMessage
12 >>> msg = signed_message_from_string('To: someone\n\nHello.')12 >>> msg = signed_message_from_string('To: someone\n\nHello.')
13 >>> verifyObject(ISignedMessage, msg)13 >>> verifyObject(ISignedMessage, msg)
14 True14 True
1515
=== modified file 'lib/canonical/launchpad/doc/sqlobject-security-proxies.txt'
--- lib/canonical/launchpad/doc/sqlobject-security-proxies.txt 2010-10-03 15:30:06 +0000
+++ lib/canonical/launchpad/doc/sqlobject-security-proxies.txt 2010-10-21 19:08:55 +0000
@@ -3,9 +3,9 @@
33
4Do some imports.4Do some imports.
55
6 >>> from zope.component import getUtility
7 >>> from lp.bugs.model.bug import BugTask
6 >>> from lp.registry.interfaces.person import IPersonSet8 >>> from lp.registry.interfaces.person import IPersonSet
7 >>> from lp.bugs.model.bug import BugTask
8 >>> from zope.component import getUtility
99
10Login as Mark.10Login as Mark.
1111
1212
=== modified file 'lib/canonical/launchpad/doc/storm.txt'
--- lib/canonical/launchpad/doc/storm.txt 2010-10-03 15:30:06 +0000
+++ lib/canonical/launchpad/doc/storm.txt 2010-10-21 19:08:55 +0000
@@ -6,14 +6,21 @@
6In addition to what Storm provides, we also have some Launchpad6In addition to what Storm provides, we also have some Launchpad
7specific Storm tools to cope with our master and slave store arrangement.7specific Storm tools to cope with our master and slave store arrangement.
88
9 >>> from canonical.launchpad.interfaces import (9 >>> from canonical.launchpad.interfaces.emailaddress import (
10 ... EmailAddressStatus, IEmailAddressSet,10 ... EmailAddressStatus,
11 ... IMasterObject, IMasterStore, ISlaveStore, IStore)11 ... IEmailAddressSet,
12 ... )
13 >>> from canonical.launchpad.interfaces.lpstorm import (
14 ... IMasterObject,
15 ... IMasterStore,
16 ... ISlaveStore,
17 ... IStore,
18 ... )
12 >>> from canonical.launchpad.database import (19 >>> from canonical.launchpad.database import (
13 ... Account, AccountPassword, EmailAddress)20 ... Account, AccountPassword, EmailAddress)
21 >>> from zope.security.proxy import ProxyFactory
14 >>> from lp.registry.interfaces.person import IPersonSet22 >>> from lp.registry.interfaces.person import IPersonSet
15 >>> from lp.registry.model.person import Person23 >>> from lp.registry.model.person import Person
16 >>> from zope.security.proxy import ProxyFactory
1724
1825
19You need to use the correct master Store to make changes to26You need to use the correct master Store to make changes to
2027
=== modified file 'lib/canonical/launchpad/doc/stripped-text-widget.txt'
--- lib/canonical/launchpad/doc/stripped-text-widget.txt 2010-10-09 16:36:22 +0000
+++ lib/canonical/launchpad/doc/stripped-text-widget.txt 2010-10-21 19:08:55 +0000
@@ -30,8 +30,8 @@
3030
31This custom widget is used to strip leading and trailing whitespaces.31This custom widget is used to strip leading and trailing whitespaces.
3232
33 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
33 >>> from canonical.widgets.textwidgets import StrippedTextWidget34 >>> from canonical.widgets.textwidgets import StrippedTextWidget
34 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
35 >>> from lp.bugs.interfaces.bugtracker import IRemoteBug35 >>> from lp.bugs.interfaces.bugtracker import IRemoteBug
3636
37We pass a string with leading and trailing whitespaces to the widget37We pass a string with leading and trailing whitespaces to the widget
3838
=== modified file 'lib/canonical/launchpad/doc/textsearching.txt'
--- lib/canonical/launchpad/doc/textsearching.txt 2010-10-09 16:36:22 +0000
+++ lib/canonical/launchpad/doc/textsearching.txt 2010-10-21 19:08:55 +0000
@@ -602,8 +602,8 @@
602rows will be excluded from the final search.602rows will be excluded from the final search.
603603
604 >>> from canonical.database.nl_search import nl_phrase_search604 >>> from canonical.database.nl_search import nl_phrase_search
605 >>> from canonical.database.sqlbase import quote
605 >>> from lp.answers.model.question import Question606 >>> from lp.answers.model.question import Question
606 >>> from canonical.database.sqlbase import quote
607607
608More than 50% of the questions matches firefox:608More than 50% of the questions matches firefox:
609609
@@ -689,8 +689,8 @@
689For example, there are less than 5 questions filed on the689For example, there are less than 5 questions filed on the
690mozilla-firefox source package.690mozilla-firefox source package.
691691
692 >>> from canonical.database.sqlbase import sqlvalues
692 >>> from lp.registry.interfaces.distribution import IDistributionSet693 >>> from lp.registry.interfaces.distribution import IDistributionSet
693 >>> from canonical.database.sqlbase import sqlvalues
694 >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu')694 >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
695 >>> firefox_package = ubuntu.getSourcePackage('mozilla-firefox')695 >>> firefox_package = ubuntu.getSourcePackage('mozilla-firefox')
696 >>> firefox_package_questions = Question.select(696 >>> firefox_package_questions = Question.select(
697697
=== modified file 'lib/canonical/launchpad/doc/timeout.txt'
--- lib/canonical/launchpad/doc/timeout.txt 2010-10-02 20:58:22 +0000
+++ lib/canonical/launchpad/doc/timeout.txt 2010-10-21 19:08:55 +0000
@@ -26,8 +26,8 @@
26The timeout to use is the number of seconds remaining before26The timeout to use is the number of seconds remaining before
27db_statement_timeout is expired.27db_statement_timeout is expired.
2828
29 >>> from canonical.config import config
29 >>> from textwrap import dedent30 >>> from textwrap import dedent
30 >>> from canonical.config import config
31 >>> config.push('timeout', dedent('''\31 >>> config.push('timeout', dedent('''\
32 ... [database]32 ... [database]
33 ... db_statement_timeout = 10000'''))33 ... db_statement_timeout = 10000'''))
@@ -88,9 +88,9 @@
8888
89 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest89 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
90 >>> from lp.services.features.model import FeatureFlag, getFeatureStore90 >>> from lp.services.features.model import FeatureFlag, getFeatureStore
91 >>> from lp.services.features import per_thread
92 >>> from lp.services.features.flags import FeatureController
91 >>> from lp.services.features.webapp import ScopesFromRequest93 >>> from lp.services.features.webapp import ScopesFromRequest
92 >>> from lp.services.features.flags import FeatureController
93 >>> from lp.services.features import per_thread
9494
95Install the feature flag to increase the timeout value.95Install the feature flag to increase the timeout value.
9696
9797
=== modified file 'lib/canonical/launchpad/doc/tokens-text-widget.txt'
--- lib/canonical/launchpad/doc/tokens-text-widget.txt 2010-10-09 16:36:22 +0000
+++ lib/canonical/launchpad/doc/tokens-text-widget.txt 2010-10-21 19:08:55 +0000
@@ -3,8 +3,8 @@
3This custom widget is used to normalise the space between words,3This custom widget is used to normalise the space between words,
4strip punctuation, and strip leading and trailing whitespace.4strip punctuation, and strip leading and trailing whitespace.
55
6 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
6 >>> from canonical.widgets.textwidgets import TokensTextWidget7 >>> from canonical.widgets.textwidgets import TokensTextWidget
7 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
8 >>> from lp.answers.interfaces.faq import IFAQ8 >>> from lp.answers.interfaces.faq import IFAQ
99
10The IFAQ keywords field requires a space separated list of terms. In the10The IFAQ keywords field requires a space separated list of terms. In the
1111
=== modified file 'lib/canonical/launchpad/doc/validation.txt'
--- lib/canonical/launchpad/doc/validation.txt 2010-10-10 15:39:28 +0000
+++ lib/canonical/launchpad/doc/validation.txt 2010-10-21 19:08:55 +0000
@@ -7,9 +7,10 @@
7The validate_distrotask() function is used to guarantee that distribution7The validate_distrotask() function is used to guarantee that distribution
8bugtasks are unique per bug.8bugtasks are unique per bug.
99
10 >>> from canonical.launchpad.interfaces import (10 >>> from canonical.launchpad.interfaces import validate_distrotask
11 ... IBugSet, IDistributionSet, ISourcePackageNameSet,11 >>> from lp.bugs.interfaces.bug import IBugSet
12 ... validate_distrotask)12 >>> from lp.registry.interfaces.distribution import IDistributionSet
13 >>> from lp.registry.interfaces.sourcepackagename import ISourcePackageNameSet
13 >>> bug_two = getUtility(IBugSet).get(2)14 >>> bug_two = getUtility(IBugSet).get(2)
14 >>> debian = getUtility(IDistributionSet).getByName('debian')15 >>> debian = getUtility(IDistributionSet).getByName('debian')
15 >>> mozilla_firefox = getUtility(16 >>> mozilla_firefox = getUtility(
@@ -31,8 +32,8 @@
31If the bug already has a distribution task with no source package, it's32If the bug already has a distribution task with no source package, it's
32not possible to add a another one.33not possible to add a another one.
3334
34 >>> from canonical.launchpad.interfaces import (35 >>> from lp.bugs.interfaces.bug import CreateBugParams
35 ... CreateBugParams, IDistributionSet)36 >>> from lp.registry.interfaces.distribution import IDistributionSet
3637
37 >>> login('no-priv@canonical.com')38 >>> login('no-priv@canonical.com')
38 >>> no_priv = getUtility(ILaunchBag).user39 >>> no_priv = getUtility(ILaunchBag).user
@@ -57,8 +58,8 @@
57It's not allowed even if the sourcepackage has been published in a58It's not allowed even if the sourcepackage has been published in a
58PPA.59PPA.
5960
61 >>> from lp.soyuz.enums import PackagePublishingStatus
60 >>> from lp.soyuz.tests.ppa import publishToPPA62 >>> from lp.soyuz.tests.ppa import publishToPPA
61 >>> from lp.soyuz.enums import PackagePublishingStatus
62 >>> publishToPPA(63 >>> publishToPPA(
63 ... person_name='cprov',64 ... person_name='cprov',
64 ... sourcepackage_name='foobar',65 ... sourcepackage_name='foobar',
6566
=== modified file 'lib/canonical/launchpad/doc/vocabularies.txt'
--- lib/canonical/launchpad/doc/vocabularies.txt 2010-10-09 16:36:22 +0000
+++ lib/canonical/launchpad/doc/vocabularies.txt 2010-10-21 19:08:55 +0000
@@ -10,9 +10,11 @@
1010
11 >>> from zope.component import getUtility11 >>> from zope.component import getUtility
12 >>> from canonical.launchpad.ftests import ANONYMOUS, login12 >>> from canonical.launchpad.ftests import ANONYMOUS, login
13 >>> from canonical.launchpad.interfaces import (
14 ... IPersonSet, IOpenLaunchBag, IProductSet, IProjectGroupSet)
15 >>> from canonical.database.sqlbase import flush_database_updates13 >>> from canonical.database.sqlbase import flush_database_updates
14 >>> from canonical.launchpad.webapp.interfaces import IOpenLaunchBag
15 >>> from lp.registry.interfaces.person import IPersonSet
16 >>> from lp.registry.interfaces.product import IProductSet
17 >>> from lp.registry.interfaces.projectgroup import IProjectGroupSet
16 >>> person_set = getUtility(IPersonSet)18 >>> person_set = getUtility(IPersonSet)
17 >>> product_set = getUtility(IProductSet)19 >>> product_set = getUtility(IProductSet)
18 >>> login('foo.bar@canonical.com')20 >>> login('foo.bar@canonical.com')
@@ -395,8 +397,8 @@
395Bug watches with an email address URL (i.e. starts with "mailto:") are397Bug watches with an email address URL (i.e. starts with "mailto:") are
396treated differently.398treated differently.
397399
398 >>> from canonical.launchpad.interfaces import (400 >>> from lp.bugs.interfaces.bugtracker import IBugTrackerSet
399 ... IBugWatchSet, IBugTrackerSet)401 >>> from lp.bugs.interfaces.bugwatch import IBugWatchSet
400402
401 >>> bug_twelve = getUtility(IBugSet).get(12)403 >>> bug_twelve = getUtility(IBugSet).get(12)
402 >>> email_bugtracker = getUtility(IBugTrackerSet).getByName('email')404 >>> email_bugtracker = getUtility(IBugTrackerSet).getByName('email')
403405
=== modified file 'lib/canonical/launchpad/doc/webapp-authorization.txt'
--- lib/canonical/launchpad/doc/webapp-authorization.txt 2010-10-18 10:11:04 +0000
+++ lib/canonical/launchpad/doc/webapp-authorization.txt 2010-10-21 19:08:55 +0000
@@ -5,8 +5,8 @@
5given object. This is the same check available in TALES as5given object. This is the same check available in TALES as
6something/required:permission.Name.6something/required:permission.Name.
77
8 >>> from zope.component import getUtility
8 >>> from canonical.launchpad.webapp.authorization import check_permission9 >>> from canonical.launchpad.webapp.authorization import check_permission
9 >>> from zope.component import getUtility
10 >>> from lp.registry.interfaces.person import IPersonSet10 >>> from lp.registry.interfaces.person import IPersonSet
1111
12 >>> personset = getUtility(IPersonSet)12 >>> personset = getUtility(IPersonSet)
@@ -60,8 +60,8 @@
60access to private objects. For instance, the above principal has60access to private objects. For instance, the above principal has
61permission to read private and non-private objects (READ_PRIVATE).61permission to read private and non-private objects (READ_PRIVATE).
6262
63 >>> from canonical.launchpad.ftests import syncUpdate
63 >>> from lp.bugs.interfaces.bug import IBugSet64 >>> from lp.bugs.interfaces.bug import IBugSet
64 >>> from canonical.launchpad.ftests import syncUpdate
65 >>> login('test@canonical.com')65 >>> login('test@canonical.com')
66 >>> bug_1 = getUtility(IBugSet).get(1)66 >>> bug_1 = getUtility(IBugSet).get(1)
67 >>> bug_1.setPrivate(True, sample_person)67 >>> bug_1.setPrivate(True, sample_person)
6868
=== modified file 'lib/canonical/launchpad/doc/webapp-publication.txt'
--- lib/canonical/launchpad/doc/webapp-publication.txt 2010-10-09 16:36:22 +0000
+++ lib/canonical/launchpad/doc/webapp-publication.txt 2010-10-21 19:08:55 +0000
@@ -144,8 +144,8 @@
144 ... LaunchpadBrowserPublication)144 ... LaunchpadBrowserPublication)
145 >>> from canonical.launchpad.webapp.servers import (145 >>> from canonical.launchpad.webapp.servers import (
146 ... LaunchpadBrowserRequest, VirtualHostRequestPublicationFactory)146 ... LaunchpadBrowserRequest, VirtualHostRequestPublicationFactory)
147 >>> from zope.app.publication.interfaces import IRequestPublicationFactory
147 >>> from canonical.launchpad.webapp.testing import verifyObject148 >>> from canonical.launchpad.webapp.testing import verifyObject
148 >>> from zope.app.publication.interfaces import IRequestPublicationFactory
149149
150Those factories provide the IRequestPublicationFactory interface.150Those factories provide the IRequestPublicationFactory interface.
151151
@@ -909,10 +909,10 @@
909In the default implementation, the following database modification will909In the default implementation, the following database modification will
910be automatically reverted in a GET request.910be automatically reverted in a GET request.
911911
912 >>> from canonical.launchpad.database import EmailAddress
912 >>> from canonical.launchpad.ftests import syncUpdate913 >>> from canonical.launchpad.ftests import syncUpdate
913 >>> from canonical.launchpad.database import EmailAddress914 >>> from canonical.launchpad.interfaces.lpstorm import IMasterStore
914 >>> from lp.registry.model.person import Person915 >>> from lp.registry.model.person import Person
915 >>> from canonical.launchpad.interfaces.lpstorm import IMasterStore
916 >>> login('foo.bar@canonical.com')916 >>> login('foo.bar@canonical.com')
917 >>> txn = transaction.begin()917 >>> txn = transaction.begin()
918 >>> def get_foo_bar_person():918 >>> def get_foo_bar_person():
@@ -965,13 +965,13 @@
965the OAuthNonce table.965the OAuthNonce table.
966966
967 >>> import time967 >>> import time
968 >>> from canonical.launchpad.interfaces.oauth import IOAuthConsumerSet
968 >>> from canonical.launchpad.webapp.interfaces import OAuthPermission969 >>> from canonical.launchpad.webapp.interfaces import OAuthPermission
969 >>> from lp.registry.interfaces.person import IPersonSet970 >>> from lp.registry.interfaces.person import IPersonSet
970 >>> from canonical.launchpad.interfaces.oauth import IOAuthConsumerSet
971971
972 >>> from zope.component import getUtility
972 >>> from canonical.launchpad.webapp.dbpolicy import MasterDatabasePolicy973 >>> from canonical.launchpad.webapp.dbpolicy import MasterDatabasePolicy
973 >>> from canonical.launchpad.webapp.interfaces import IStoreSelector974 >>> from canonical.launchpad.webapp.interfaces import IStoreSelector
974 >>> from zope.component import getUtility
975 >>> getUtility(IStoreSelector).push(MasterDatabasePolicy())975 >>> getUtility(IStoreSelector).push(MasterDatabasePolicy())
976976
977 >>> salgado = getUtility(IPersonSet).getByName('salgado')977 >>> salgado = getUtility(IPersonSet).getByName('salgado')
978978
=== modified file 'lib/canonical/launchpad/doc/webservice-configuration.txt'
--- lib/canonical/launchpad/doc/webservice-configuration.txt 2009-04-17 10:32:16 +0000
+++ lib/canonical/launchpad/doc/webservice-configuration.txt 2010-10-21 19:08:55 +0000
@@ -24,8 +24,8 @@
24based on the site configuration and whether the requesting user is a24based on the site configuration and whether the requesting user is a
25developer.25developer.
2626
27 >>> from canonical.config import config
27 >>> from textwrap import dedent28 >>> from textwrap import dedent
28 >>> from canonical.config import config
2929
30 >>> from zope.interface import implements30 >>> from zope.interface import implements
31 >>> from canonical.launchpad.webapp.interfaces import ILaunchBag31 >>> from canonical.launchpad.webapp.interfaces import ILaunchBag
3232
=== modified file 'lib/canonical/launchpad/doc/webservice-marshallers.txt'
--- lib/canonical/launchpad/doc/webservice-marshallers.txt 2010-10-09 16:36:22 +0000
+++ lib/canonical/launchpad/doc/webservice-marshallers.txt 2010-10-21 19:08:55 +0000
@@ -8,8 +8,10 @@
8application root.8application root.
99
10 >>> from canonical.launchpad.webapp.adapter import set_request_started10 >>> from canonical.launchpad.webapp.adapter import set_request_started
11 >>> from canonical.launchpad.webapp.servers import WebServiceTestRequest11 >>> from canonical.launchpad.webapp.servers import (
12 >>> from canonical.launchpad.webapp.servers import WebServicePublication12 ... WebServicePublication,
13 ... WebServiceTestRequest,
14 ... )
13 >>> request = WebServiceTestRequest(method='GET')15 >>> request = WebServiceTestRequest(method='GET')
14 >>> set_request_started()16 >>> set_request_started()
15 >>> request.setPublication(WebServicePublication(None))17 >>> request.setPublication(WebServicePublication(None))
@@ -29,12 +31,12 @@
29string is a URL corresponding to a vocabulary item, the marshaller31string is a URL corresponding to a vocabulary item, the marshaller
30returns that item. Otherwise it raises a ValueError.32returns that item. Otherwise it raises a ValueError.
3133
32 >>> from lp.registry.interfaces.person import IPerson
33 >>> from zope.component import getMultiAdapter34 >>> from zope.component import getMultiAdapter
34 >>> from zope.schema import Choice35 >>> from zope.schema import Choice
36 >>> from lazr.restful import EntryResource
35 >>> from lazr.restful.fields import ReferenceChoice37 >>> from lazr.restful.fields import ReferenceChoice
36 >>> from lazr.restful.interfaces import IFieldMarshaller38 >>> from lazr.restful.interfaces import IFieldMarshaller
37 >>> from lazr.restful import EntryResource39 >>> from lp.registry.interfaces.person import IPerson
3840
39 # Bind the field, to resolve the vocabulary name.41 # Bind the field, to resolve the vocabulary name.
40 >>> field = ReferenceChoice(42 >>> field = ReferenceChoice(
4143
=== modified file 'lib/canonical/launchpad/doc/xmlrpc-authserver.txt'
--- lib/canonical/launchpad/doc/xmlrpc-authserver.txt 2010-10-03 15:30:06 +0000
+++ lib/canonical/launchpad/doc/xmlrpc-authserver.txt 2010-10-21 19:08:55 +0000
@@ -3,8 +3,10 @@
3The AuthServer interface is available on the authserver attribute3The AuthServer interface is available on the authserver attribute
4of our private XMLRPC instance.4of our private XMLRPC instance.
55
6 >>> from canonical.launchpad.interfaces import (6 >>> from canonical.launchpad.interfaces.launchpad import (
7 ... IAuthServerApplication, IPrivateApplication)7 ... IAuthServerApplication,
8 ... IPrivateApplication,
9 ... )
8 >>> from canonical.launchpad.webapp.testing import verifyObject10 >>> from canonical.launchpad.webapp.testing import verifyObject
911
10 >>> private_root = getUtility(IPrivateApplication)12 >>> private_root = getUtility(IPrivateApplication)
1113
=== modified file 'lib/canonical/launchpad/interfaces/ftests/validation.txt'
--- lib/canonical/launchpad/interfaces/ftests/validation.txt 2010-10-03 15:30:06 +0000
+++ lib/canonical/launchpad/interfaces/ftests/validation.txt 2010-10-21 19:08:55 +0000
@@ -1,16 +1,17 @@
1= Launchpad field validators =1= Launchpad field validators =
22
3 >>> from zope.component import getUtility3 >>> from zope.component import getUtility
4 >>> from canonical.launchpad.interfaces import (4 >>> from canonical.launchpad.webapp.interfaces import IOpenLaunchBag
5 ... CreateBugParams, IOpenLaunchBag, IPersonSet, IProductSet)5 >>> from lp.bugs.interfaces.bug import CreateBugParams
6 >>> from lp.registry.interfaces.person import IPersonSet
7 >>> from lp.registry.interfaces.product import IProductSet
68
7== can_be_nominated_for_series ==9== can_be_nominated_for_series ==
810
9This validator is used to check if the bug in the launchbag can be11This validator is used to check if the bug in the launchbag can be
10nominated for the given series.12nominated for the given series.
1113
12 >>> from canonical.launchpad.interfaces import (14 >>> from canonical.launchpad.interfaces import can_be_nominated_for_series
13 ... can_be_nominated_for_series)
1415
15If we create a new bug, all the target's series can be nominated.16If we create a new bug, all the target's series can be nominated.
1617
1718
=== modified file 'lib/canonical/launchpad/pagetests/feeds/xx-links.txt'
--- lib/canonical/launchpad/pagetests/feeds/xx-links.txt 2010-10-03 15:30:06 +0000
+++ lib/canonical/launchpad/pagetests/feeds/xx-links.txt 2010-10-21 19:08:55 +0000
@@ -116,8 +116,11 @@
116 >>> from canonical.database.sqlbase import flush_database_updates116 >>> from canonical.database.sqlbase import flush_database_updates
117 >>> login('foo.bar@canonical.com')117 >>> login('foo.bar@canonical.com')
118 >>> from zope.component import getUtility118 >>> from zope.component import getUtility
119 >>> from canonical.launchpad.interfaces import (119 >>> from canonical.launchpad.webapp.interfaces import ILaunchBag
120 ... ILaunchBag, IProductSet, License)120 >>> from lp.registry.interfaces.product import (
121 ... IProductSet,
122 ... License,
123 ... )
121 >>> user = getUtility(ILaunchBag).user124 >>> user = getUtility(ILaunchBag).user
122 >>> getUtility(IProductSet).createProduct(125 >>> getUtility(IProductSet).createProduct(
123 ... user, 'bad-displayname',126 ... user, 'bad-displayname',
124127
=== modified file 'lib/canonical/launchpad/pagetests/oauth/access-token.txt'
--- lib/canonical/launchpad/pagetests/oauth/access-token.txt 2010-10-03 15:30:06 +0000
+++ lib/canonical/launchpad/pagetests/oauth/access-token.txt 2010-10-21 19:08:55 +0000
@@ -5,10 +5,11 @@
5access token.5access token.
66
7 # First we create a new request token and review it.7 # First we create a new request token and review it.
8 >>> from zope.component import getUtility
9 >>> from canonical.launchpad.interfaces.oauth import IOAuthConsumerSet
8 >>> from canonical.launchpad.webapp.interfaces import OAuthPermission10 >>> from canonical.launchpad.webapp.interfaces import OAuthPermission
9 >>> from canonical.launchpad.interfaces import (11 >>> from lp.registry.interfaces.person import IPersonSet
10 ... IOAuthConsumerSet, IPersonSet, IProductSet)12 >>> from lp.registry.interfaces.product import IProductSet
11 >>> from zope.component import getUtility
12 >>> from canonical.launchpad.ftests import login, logout13 >>> from canonical.launchpad.ftests import login, logout
13 >>> login('salgado@ubuntu.com')14 >>> login('salgado@ubuntu.com')
14 >>> consumer = getUtility(IOAuthConsumerSet).getByKey('foobar123451432')15 >>> consumer = getUtility(IOAuthConsumerSet).getByKey('foobar123451432')
1516
=== modified file 'lib/canonical/launchpad/pagetests/oauth/authorize-token.txt'
--- lib/canonical/launchpad/pagetests/oauth/authorize-token.txt 2010-10-18 10:11:04 +0000
+++ lib/canonical/launchpad/pagetests/oauth/authorize-token.txt 2010-10-21 19:08:55 +0000
@@ -4,14 +4,21 @@
4Launchpad's +authorize-token page in order for the user to authenticate4Launchpad's +authorize-token page in order for the user to authenticate
5and authorize or not the consumer to act on his behalf.5and authorize or not the consumer to act on his behalf.
66
7 >>> def request_token_for(consumer):
8 ... """Helper method to create a request token."""
9 ... login('salgado@ubuntu.com')
10 ... token = consumer.newRequestToken()
11 ... logout()
12 ... return token
13
7 # Create a new request token.14 # Create a new request token.
15 >>> from zope.component import getUtility
8 >>> from canonical.launchpad.interfaces.oauth import IOAuthConsumerSet16 >>> from canonical.launchpad.interfaces.oauth import IOAuthConsumerSet
9 >>> from zope.component import getUtility
10 >>> from canonical.launchpad.ftests import ANONYMOUS, login, logout17 >>> from canonical.launchpad.ftests import ANONYMOUS, login, logout
11 >>> login('salgado@ubuntu.com')18 >>> login('salgado@ubuntu.com')
12 >>> consumer = getUtility(IOAuthConsumerSet).getByKey('foobar123451432')19 >>> consumer = getUtility(IOAuthConsumerSet).getByKey('foobar123451432')
13 >>> token = consumer.newRequestToken()
14 >>> logout()20 >>> logout()
21 >>> token = request_token_for(consumer)
1522
16According to the OAuth Core 1.0 spec, the request to the service23According to the OAuth Core 1.0 spec, the request to the service
17provider's user authorization URL (+authorize-token in our case) must24provider's user authorization URL (+authorize-token in our case) must
@@ -71,10 +78,13 @@
71that isn't enough for the application. The user always has the option78that isn't enough for the application. The user always has the option
72to deny permission altogether.79to deny permission altogether.
7380
74 >>> def authorize_token_main_content(allow_permission):81 >>> def authorize_token_browser(allow_permission):
75 ... browser.open(82 ... browser.open(
76 ... "http://launchpad.dev/+authorize-token?%s&%s"83 ... "http://launchpad.dev/+authorize-token?%s&%s"
77 ... % (urlencode(params), allow_permission))84 ... % (urlencode(params), allow_permission))
85
86 >>> def authorize_token_main_content(allow_permission):
87 ... authorize_token_browser(allow_permission)
78 ... return find_tag_by_id(browser.contents, 'maincontent')88 ... return find_tag_by_id(browser.contents, 'maincontent')
7989
80 >>> def print_access_levels_for(allow_permission):90 >>> def print_access_levels_for(allow_permission):
@@ -196,10 +206,7 @@
196+authorized-token.206+authorized-token.
197207
198 # Create a new (unreviewed) token.208 # Create a new (unreviewed) token.
199 >>> logout()209 >>> token = request_token_for(consumer)
200 >>> login('salgado@ubuntu.com')
201 >>> token = consumer.newRequestToken()
202 >>> logout()
203210
204 >>> params = dict(oauth_token=token.key)211 >>> params = dict(oauth_token=token.key)
205 >>> browser.open(212 >>> browser.open(
@@ -268,14 +275,15 @@
268The desktop integration option is only available for OAuth consumers275The desktop integration option is only available for OAuth consumers
269that say what kind of desktop they are (eg. Ubuntu) and give a name276that say what kind of desktop they are (eg. Ubuntu) and give a name
270that a user can identify with their computer (eg. the hostname). Here,277that a user can identify with their computer (eg. the hostname). Here,
271we'll create such a token.278we'll create such a consumer, and then a request token for that consumer.
272279
273 >>> login('salgado@ubuntu.com')280 >>> login('foo.bar@canonical.com')
274 >>> desktop_key = "System-wide: Ubuntu desktop (mycomputer)"281 >>> consumer = factory.makeOAuthConsumer(
275 >>> consumer = getUtility(IOAuthConsumerSet).new(desktop_key)282 ... "System-wide: Ubuntu desktop (mycomputer)")
276 >>> token = consumer.newRequestToken()
277 >>> logout()283 >>> logout()
278284
285 >>> token = request_token_for(consumer)
286
279When a desktop tries to integrate with Launchpad, the user gets a287When a desktop tries to integrate with Launchpad, the user gets a
280special warning about giving access to every program running on their288special warning about giving access to every program running on their
281desktop.289desktop.
@@ -284,34 +292,42 @@
284 >>> print extract_text(292 >>> print extract_text(
285 ... authorize_token_main_content(293 ... authorize_token_main_content(
286 ... 'allow_permission=DESKTOP_INTEGRATION'))294 ... 'allow_permission=DESKTOP_INTEGRATION'))
287 Integrating mycomputer into your Launchpad account295 Confirm Computer Access
288 The Ubuntu desktop called mycomputer wants access to your296 The Ubuntu desktop called mycomputer wants access to your
289 Launchpad account. If you allow the integration, all applications297 Launchpad account. If you allow this, every application running on
290 running on mycomputer will have read-write access to your298 mycomputer will have read-write access to your Launchpad account,
291 Launchpad account, including to your private data.299 including to your private data.
292 If you're using a public computer, if mycomputer is not the300 If you're using a public computer, if mycomputer is not the
293 computer you're using right now, or if something just doesn't feel301 computer you're using right now, or if something just doesn't feel
294 right about this situation, you should choose "No, thanks, I don't302 right about this situation, you should choose "Do Not Allow
295 trust 'mycomputer'", or close this window now. You can always try303 'mycomputer' to Access my Launchpad Account", or close this window
296 again later.304 now. You can always try again later.
297 Even if you decide to allow the integration, you can change your305 Even if you decide to give mycomputer access to your Launchpad
298 mind later.306 account, you can change your mind later.
307 Allow mycomputer to access my Launchpad account:
308 or
299 See all applications authorized to access Launchpad on your behalf.309 See all applications authorized to access Launchpad on your behalf.
300310
301
302The only time the 'Desktop Integration' permission shows up in the311The only time the 'Desktop Integration' permission shows up in the
303list of permissions is if the client specifically requests it, and no312list of permissions is if the client specifically requests it, and no
304other permission. (Also requesting UNAUTHORIZED is okay--it will show313other permission. (Also requesting UNAUTHORIZED is okay--it will show
305up anyway.)314up anyway.)
306315
307 >>> print_access_levels_for('allow_permission=DESKTOP_INTEGRATION')316 >>> allow_desktop = 'allow_permission=DESKTOP_INTEGRATION'
308 Give all programs running on "mycomputer" access to my Launchpad account.317 >>> print_access_levels_for(allow_desktop)
309 No, thanks, I don't trust "mycomputer".318 Until I Disable It
319 For One Hour
320 For One Day
321 For One Week
322 Do Not Allow "mycomputer" to Access my Launchpad Account.
310323
311 >>> print_access_levels_for(324 >>> print_access_levels_for(
312 ... 'allow_permission=DESKTOP_INTEGRATION&allow_permission=UNAUTHORIZED')325 ... 'allow_permission=DESKTOP_INTEGRATION&allow_permission=UNAUTHORIZED')
313 Give all programs running on "mycomputer" access to my Launchpad account.326 Until I Disable It
314 No, thanks, I don't trust "mycomputer".327 For One Hour
328 For One Day
329 For One Week
330 Do Not Allow "mycomputer" to Access my Launchpad Account.
315331
316A desktop may not request a level of access other than332A desktop may not request a level of access other than
317DESKTOP_INTEGRATION, since the whole point is to have a permission333DESKTOP_INTEGRATION, since the whole point is to have a permission
@@ -324,7 +340,7 @@
324 ("Change Anything") not supported for desktop-wide use.340 ("Change Anything") not supported for desktop-wide use.
325341
326 >>> print_access_levels_for(342 >>> print_access_levels_for(
327 ... 'allow_permission=WRITE_PUBLIC&allow_permission=DESKTOP_INTEGRATION')343 ... 'allow_permission=WRITE_PUBLIC&' + allow_desktop)
328 Traceback (most recent call last):344 Traceback (most recent call last):
329 ...345 ...
330 Unauthorized: Desktop integration token requested a permission346 Unauthorized: Desktop integration token requested a permission
@@ -335,7 +351,7 @@
335websites into Launchpad.351websites into Launchpad.
336352
337 >>> params['oauth_callback'] = 'http://launchpad.dev/bzr'353 >>> params['oauth_callback'] = 'http://launchpad.dev/bzr'
338 >>> print_access_levels_for('allow_permission=DESKTOP_INTEGRATION')354 >>> print_access_levels_for(allow_desktop)
339 Traceback (most recent call last):355 Traceback (most recent call last):
340 ...356 ...
341 Unauthorized: A desktop integration may not specify an OAuth357 Unauthorized: A desktop integration may not specify an OAuth
@@ -349,3 +365,126 @@
349 ...365 ...
350 Unauthorized: A desktop integration may not specify an OAuth366 Unauthorized: A desktop integration may not specify an OAuth
351 callback URL.367 callback URL.
368
369 >>> del params['oauth_callback']
370
371Accepting full integration
372--------------------------
373
374Now let's create a helper function to go through the entire desktop
375integration process, given the name of the desktop and the level of
376integration desired.
377
378 >>> def integrate_desktop(button_to_click):
379 ... """Authorize (or don't) a desktop integration request token.
380 ... The token is authorized for the computer "mycomputer".
381 ...
382 ... :return: the IOAuthRequestToken, possibly authorized.
383 ... """
384 ... token = request_token_for(consumer)
385 ... params['oauth_token'] = token.key
386 ... authorize_token_browser(allow_desktop)
387 ... button = browser.getControl(button_to_click)
388 ... button.click()
389 ... return token
390
391If the client chooses a permanent desktop integration, the request
392token is approved and has no expiration date.
393
394 >>> token = integrate_desktop("Until I Disable It")
395 >>> print extract_text(find_tag_by_id(browser.contents, 'maincontent'))
396 Almost finished ...
397 The Ubuntu desktop called mycomputer now has access to your
398 Launchpad account. Within a few seconds, you should be able to
399 start using its Launchpad integration features.
400
401 >>> print token.is_reviewed
402 True
403 >>> print token.permission.name
404 DESKTOP_INTEGRATION
405 >>> print token.date_expires
406 None
407
408Accepting time-limited integration
409----------------------------------
410
411If you allow integration for a limited time, the request token is
412reviewed and given an expiration date. Here, we authorize a token for
413one hour.
414
415 >>> token = integrate_desktop("For One Hour")
416
417 >>> print extract_text(find_tag_by_id(browser.contents, 'maincontent'))
418 Almost finished ...
419 The Ubuntu desktop called mycomputer now has access to your
420 Launchpad account. Within a few seconds, you should be able to
421 start using its Launchpad integration features.
422 The integration you just authorized will expire in 59 minutes. At
423 that time, you'll have to re-authorize the Ubuntu desktop called
424 mycomputer, if you want to keep using its Launchpad integration
425 features.
426
427 >>> print token.is_reviewed
428 True
429 >>> print token.permission.name
430 DESKTOP_INTEGRATION
431 >>> token.date_expires is None
432 False
433
434Note that a single computer (in this case "mycomputer") may have more
435than one desktop integration token. This is because there's no way to
436know that a user hasn't given more than one computer the same name
437(eg. "ubuntu" or "localhost"). The assignment of computer names to
438integration tokens is a useful convention, not something we try to
439enforce.
440
441Here we authorize a token for one day.
442
443 >>> token = integrate_desktop("For One Day")
444
445 >>> print extract_text(find_tag_by_id(browser.contents, 'maincontent'))
446 Almost finished ...
447 The integration you just authorized will expire in 23 hours.
448 ...
449
450 >>> print token.is_reviewed
451 True
452 >>> token.date_expires is None
453 False
454
455Here, we authorize a token for a week. The expiration time is given as
456a date.
457
458 >>> token = integrate_desktop("For One Week")
459
460 >>> print extract_text(find_tag_by_id(browser.contents, 'maincontent'))
461 Almost finished ...
462 The integration you just authorized will expire 2...
463 ...
464
465 >>> print token.is_reviewed
466 True
467 >>> print token.permission.name
468 DESKTOP_INTEGRATION
469 >>> token.date_expires is None
470 False
471
472Declining integration
473---------------------
474
475If the client declines integration, the request token is reviewed but
476cannot be exchanged for an access token.
477
478 >>> token = integrate_desktop(
479 ... """Do Not Allow "mycomputer" to Access my Launchpad Account.""")
480
481 >>> print extract_text(find_tag_by_id(browser.contents, 'maincontent'))
482 You decided against desktop integration
483 You decided not to give the Ubuntu desktop called mycomputer
484 access to your Launchpad account. You can always change your mind
485 later.
486
487 >>> print token.is_reviewed
488 True
489 >>> print token.permission.name
490 UNAUTHORIZED
352491
=== modified file 'lib/canonical/launchpad/pagetests/oauth/managing-tokens.txt'
--- lib/canonical/launchpad/pagetests/oauth/managing-tokens.txt 2010-10-03 15:30:06 +0000
+++ lib/canonical/launchpad/pagetests/oauth/managing-tokens.txt 2010-10-21 19:08:55 +0000
@@ -5,9 +5,10 @@
55
6 # Create a request token, but don't convert it to an access token.6 # Create a request token, but don't convert it to an access token.
7 >>> from zope.component import getUtility7 >>> from zope.component import getUtility
8 >>> from canonical.launchpad.interfaces.oauth import IOAuthConsumerSet
8 >>> from canonical.launchpad.webapp.interfaces import OAuthPermission9 >>> from canonical.launchpad.webapp.interfaces import OAuthPermission
9 >>> from canonical.launchpad.interfaces import (10 >>> from lp.registry.interfaces.person import IPersonSet
10 ... IOAuthConsumerSet, IPersonSet, IProductSet)11 >>> from lp.registry.interfaces.product import IProductSet
11 >>> login('salgado@ubuntu.com')12 >>> login('salgado@ubuntu.com')
12 >>> token = getUtility(IOAuthConsumerSet).getByKey(13 >>> token = getUtility(IOAuthConsumerSet).getByKey(
13 ... 'foobar123451432').newRequestToken()14 ... 'foobar123451432').newRequestToken()
1415
=== modified file 'lib/canonical/launchpad/pagetests/standalone/xx-opstats.txt'
--- lib/canonical/launchpad/pagetests/standalone/xx-opstats.txt 2010-10-09 16:36:22 +0000
+++ lib/canonical/launchpad/pagetests/standalone/xx-opstats.txt 2010-10-21 19:08:55 +0000
@@ -261,8 +261,8 @@
261261
262But our database connections are broken.262But our database connections are broken.
263263
264 >>> from canonical.launchpad.interfaces.lpstorm import IStore
264 >>> from lp.registry.model.person import Person265 >>> from lp.registry.model.person import Person
265 >>> from canonical.launchpad.interfaces.lpstorm import IStore
266 >>> IStore(Person).find(Person, name='janitor')266 >>> IStore(Person).find(Person, name='janitor')
267 Traceback (most recent call last):267 Traceback (most recent call last):
268 ...268 ...
269269
=== modified file 'lib/canonical/launchpad/pagetests/standalone/xx-request-expired.txt'
--- lib/canonical/launchpad/pagetests/standalone/xx-request-expired.txt 2010-07-05 19:25:14 +0000
+++ lib/canonical/launchpad/pagetests/standalone/xx-request-expired.txt 2010-10-21 19:08:55 +0000
@@ -6,9 +6,9 @@
6slightly longer then the soft_request_timeout value to generate, thus6slightly longer then the soft_request_timeout value to generate, thus
7causing a soft timeout to be logged.7causing a soft timeout to be logged.
88
9 >>> from textwrap import dedent
10 >>> from canonical.config import config9 >>> from canonical.config import config
11 >>> from canonical.launchpad.webapp.errorlog import globalErrorUtility10 >>> from canonical.launchpad.webapp.errorlog import globalErrorUtility
11 >>> from textwrap import dedent
12 >>> old_lastid = globalErrorUtility.getLastOopsReport().id12 >>> old_lastid = globalErrorUtility.getLastOopsReport().id
13 >>> test_data = dedent("""13 >>> test_data = dedent("""
14 ... [database]14 ... [database]
1515
=== modified file 'lib/canonical/launchpad/pagetests/standalone/xx-soft-timeout.txt'
--- lib/canonical/launchpad/pagetests/standalone/xx-soft-timeout.txt 2010-07-05 19:25:14 +0000
+++ lib/canonical/launchpad/pagetests/standalone/xx-soft-timeout.txt 2010-10-21 19:08:55 +0000
@@ -39,8 +39,8 @@
39slightly longer then the soft_request_timeout value to generate, thus39slightly longer then the soft_request_timeout value to generate, thus
40causing a soft timeout to be logged.40causing a soft timeout to be logged.
4141
42 >>> from canonical.launchpad.webapp.errorlog import globalErrorUtility
42 >>> from textwrap import dedent43 >>> from textwrap import dedent
43 >>> from canonical.launchpad.webapp.errorlog import globalErrorUtility
44 >>> old_lastid = globalErrorUtility.getLastOopsReport().id44 >>> old_lastid = globalErrorUtility.getLastOopsReport().id
45 >>> test_data = (dedent("""45 >>> test_data = (dedent("""
46 ... [database]46 ... [database]
4747
=== modified file 'lib/canonical/launchpad/pagetests/webservice/xx-service.txt'
--- lib/canonical/launchpad/pagetests/webservice/xx-service.txt 2010-10-09 16:36:22 +0000
+++ lib/canonical/launchpad/pagetests/webservice/xx-service.txt 2010-10-21 19:08:55 +0000
@@ -45,8 +45,8 @@
45 >>> config.push('beta_data', beta_data)45 >>> config.push('beta_data', beta_data)
4646
47 >>> from lp.testing import ANONYMOUS, login, logout47 >>> from lp.testing import ANONYMOUS, login, logout
48 >>> from zope.component import getUtility
48 >>> from canonical.launchpad.testing.pages import webservice_for_person49 >>> from canonical.launchpad.testing.pages import webservice_for_person
49 >>> from zope.component import getUtility
50 >>> from lp.registry.interfaces.person import IPersonSet50 >>> from lp.registry.interfaces.person import IPersonSet
51 >>> login(ANONYMOUS)51 >>> login(ANONYMOUS)
52 >>> beta_admin = getUtility(IPersonSet).getByEmail(52 >>> beta_admin = getUtility(IPersonSet).getByEmail(
5353
=== modified file 'lib/canonical/launchpad/pagetests/webservice/xx-wadl.txt'
--- lib/canonical/launchpad/pagetests/webservice/xx-wadl.txt 2010-03-29 14:30:51 +0000
+++ lib/canonical/launchpad/pagetests/webservice/xx-wadl.txt 2010-10-21 19:08:55 +0000
@@ -61,8 +61,8 @@
6161
62Unlike the test strings we used earlier, this is a valid WADL file.62Unlike the test strings we used earlier, this is a valid WADL file.
6363
64 >>> from canonical.lazr.xml import XMLValidator
64 >>> from lazr.restful import WADL_SCHEMA_FILE65 >>> from lazr.restful import WADL_SCHEMA_FILE
65 >>> from canonical.lazr.xml import XMLValidator
66 >>> wadl_schema = XMLValidator(WADL_SCHEMA_FILE)66 >>> wadl_schema = XMLValidator(WADL_SCHEMA_FILE)
6767
68 # We need to replace the nbsp entity, because the validator68 # We need to replace the nbsp entity, because the validator
6969
=== modified file 'lib/canonical/launchpad/templates/oauth-authorize.pt'
--- lib/canonical/launchpad/templates/oauth-authorize.pt 2010-10-05 16:06:02 +0000
+++ lib/canonical/launchpad/templates/oauth-authorize.pt 2010-10-21 19:08:55 +0000
@@ -23,17 +23,14 @@
23 <div metal:fill-slot="extra_top">23 <div metal:fill-slot="extra_top">
2424
25 <tal:desktop-integration-token condition="token/consumer/is_integrated_desktop">25 <tal:desktop-integration-token condition="token/consumer/is_integrated_desktop">
26 <h1>Integrating26 <h1>Confirm Computer Access</h1>
27 <tal:hostname replace="structure
28 token/consumer/integrated_desktop_name" />
29 into your Launchpad account</h1>
30 <p>The27 <p>The
31 <tal:desktop replace="structure28 <tal:desktop replace="structure
32 token/consumer/integrated_desktop_type" />29 token/consumer/integrated_desktop_type" />
33 called30 called
34 <strong tal:content="token/consumer/integrated_desktop_name">hostname</strong>31 <strong tal:content="token/consumer/integrated_desktop_name">hostname</strong>
35 wants access to your Launchpad account. If you allow the32 wants access to your Launchpad account. If you allow this,
36 integration, all applications running33 every application running
37 on <strong tal:content="token/consumer/integrated_desktop_name">hostname</strong>34 on <strong tal:content="token/consumer/integrated_desktop_name">hostname</strong>
38 will have read-write access to your Launchpad account,35 will have read-write access to your Launchpad account,
39 including to your private data.</p>36 including to your private data.</p>
@@ -42,14 +39,37 @@
42 <strong tal:content="token/consumer/integrated_desktop_name">hostname</strong>39 <strong tal:content="token/consumer/integrated_desktop_name">hostname</strong>
43 is not the computer you're using right now, or if40 is not the computer you're using right now, or if
44 something just doesn't feel right about this situation,41 something just doesn't feel right about this situation,
45 you should choose "No, thanks, I don't trust42 you should choose "Do Not Allow
46 '<tal:hostname replace="structure43 '<tal:hostname replace="structure
47 token/consumer/integrated_desktop_name" />'",44 token/consumer/integrated_desktop_name" />' to Access
48 or close this window now. You can always try45 my Launchpad Account", or close this window now. You can
49 again later.</p>46 always try again later.</p>
5047
51 <p>Even if you decide to allow the integration, you can48 <p>Even if you decide to give
52 change your mind later.</p>49 <strong tal:content="token/consumer/integrated_desktop_name">hostname</strong>
50 access to your Launchpad account, you can change your
51 mind later.</p>
52
53 <p>
54 Allow <strong tal:content="token/consumer/integrated_desktop_name">hostname</strong>
55 to access my Launchpad account:
56 </p>
57 <p class="subordinate">
58 <tal:actions
59 repeat="action view/visible_desktop_integration_actions">
60 <input tal:replace="structure action/render" />
61 </tal:actions>
62 </p>
63
64 <p>or</p>
65 <p class="subordinate">
66 <input
67 tal:replace="structure view/unauthorized_action/render" />
68 </p>
69
70 <input type="hidden" name="allow_permission"
71 value="DESKTOP_INTEGRATION" />
72
53 </tal:desktop-integration-token>73 </tal:desktop-integration-token>
5474
55 <tal:web-integration-token condition="not:token/consumer/is_integrated_desktop">75 <tal:web-integration-token condition="not:token/consumer/is_integrated_desktop">
@@ -67,29 +87,29 @@
67 </tal:has-context>87 </tal:has-context>
68 Launchpad on your behalf. What level of access88 Launchpad on your behalf. What level of access
69 do you want to grant?</p>89 do you want to grant?</p>
90
91 <table>
92 <tr tal:repeat="action view/visible_actions">
93 <td style="text-align: right">
94 <tal:action replace="structure action/render" />
95 <input type="hidden" name="allow_permission"
96 tal:attributes="value action/permission/name" />
97 </td>
98
99 <td>
100 <span class="lesser"
101 tal:content="action/permission/description" />
102 </td>
103 </tr>
104 </table>
70 </tal:web-integration-token>105 </tal:web-integration-token>
71
72 <table>
73 <tr tal:repeat="action view/visible_actions">
74 <td style="text-align: right">
75 <tal:action replace="structure action/render" />
76 </td>
77
78 <tal:web-integration-token
79 condition="not:token/consumer/is_integrated_desktop">
80 <td>
81 <span class="lesser"
82 tal:content="action/permission/description" />
83 </td>
84 </tal:web-integration-token>
85 </tr>
86 </table>
87 </div>106 </div>
88107
89 <div metal:fill-slot="extra_bottom">108 <div metal:fill-slot="extra_bottom">
90 <input type="hidden" name="oauth_token"109 <input type="hidden" name="oauth_token"
91 tal:condition="request/form/oauth_token|nothing"110 tal:condition="request/form/oauth_token|nothing"
92 tal:attributes="value request/form/oauth_token" />111 tal:attributes="value request/form/oauth_token" />
112
93 <input type="hidden" name="oauth_callback"113 <input type="hidden" name="oauth_callback"
94 tal:condition="request/form/oauth_callback|nothing"114 tal:condition="request/form/oauth_callback|nothing"
95 tal:attributes="value request/form/oauth_callback" />115 tal:attributes="value request/form/oauth_callback" />
96116
=== modified file 'lib/canonical/launchpad/templates/token-authorized.pt'
--- lib/canonical/launchpad/templates/token-authorized.pt 2009-07-17 17:59:07 +0000
+++ lib/canonical/launchpad/templates/token-authorized.pt 2010-10-21 19:08:55 +0000
@@ -8,25 +8,71 @@
8>8>
9<body>9<body>
10 <div class="top-portlet" metal:fill-slot="main">10 <div class="top-portlet" metal:fill-slot="main">
11 <tal:unauthorized condition="view/token/permission/enumvalue:UNAUTHORIZED">11
12 <h1>Access not granted to application</h1>12 <tal:desktop condition="view/token/consumer/is_integrated_desktop">
13 <p>13
14 The application identified as14 <tal:unauthorized condition="view/token/permission/enumvalue:UNAUTHORIZED">
15 <strong tal:content="view/token/consumer/key">key</strong> has not15 <h1>You decided against desktop integration</h1>
16 been given access to your protected resources on Launchpad.16
17 </p>17 <p>
18 </tal:unauthorized>18 You decided not to give the
1919 <tal:desktop replace="structure view/token/consumer/integrated_desktop_type" />
20 <tal:authorized condition="not:view/token/permission/enumvalue:UNAUTHORIZED">20 called
21 <h1>Almost finished ...</h1>21 <strong tal:content="view/token/consumer/integrated_desktop_name">hostname</strong>
22 <p>22 access to your Launchpad account. You can always change your
23 mind later.
24 </p>
25 </tal:unauthorized>
26
27 <tal:authorized condition="not:view/token/permission/enumvalue:UNAUTHORIZED">
28 <h1>Almost finished ...</h1>
29
30 <p>The
31 <tal:desktop replace="structure view/token/consumer/integrated_desktop_type" />
32 called
33 <strong tal:content="view/token/consumer/integrated_desktop_name">hostname</strong>
34 now has access to your Launchpad account. Within a few
35 seconds, you should be able to start using its Launchpad
36 integration features.</p>
37
38 <p tal:condition="view/token/date_expires">
39 The integration you just authorized will expire
40 <tal:date
41 replace="structure view/token/date_expires/fmt:approximatedate" />.
42 At that time, you'll have to re-authorize the
43 <tal:desktop replace="structure view/token/consumer/integrated_desktop_type" />
44 called
45 <strong tal:content="view/token/consumer/integrated_desktop_name">hostname</strong>,
46 if you want to keep using its Launchpad integration features.
47
48 </p>
49
50 </tal:authorized>
51 </tal:desktop>
52
53 <tal:application condition="not:view/token/consumer/is_integrated_desktop">
54
55 <tal:unauthorized condition="view/token/permission/enumvalue:UNAUTHORIZED">
56 <h1>Access not granted to application</h1>
57 <p>
58 The application identified as
59 <strong tal:content="view/token/consumer/key">key</strong> has not
60 been given access to your protected resources on Launchpad.
61 </p>
62 </tal:unauthorized>
63
64 <tal:authorized condition="not:view/token/permission/enumvalue:UNAUTHORIZED">
65 <h1>Almost finished ...</h1>
66 <p>
23 To finish authorizing the application identified as67 To finish authorizing the application identified as
24 <strong tal:content="view/token/consumer/key">key</strong> to access68 <strong tal:content="view/token/consumer/key">key</strong> to access
25 Launchpad on your behalf you should go back to the application window69 Launchpad on your behalf you should go back to the application window
26 in which you started the process and inform it that you have done your70 in which you started the process and inform it that you have done your
27 part of the process.71 part of the process.
28 </p>72 </p>
29 </tal:authorized>73 </tal:authorized>
74
75 </tal:application>
30 </div>76 </div>
3177
32</body>78</body>
3379
=== modified file 'lib/canonical/launchpad/webapp/ftests/test_adapter_timeout.txt.disabled'
--- lib/canonical/launchpad/webapp/ftests/test_adapter_timeout.txt.disabled 2009-06-02 08:20:49 +0000
+++ lib/canonical/launchpad/webapp/ftests/test_adapter_timeout.txt.disabled 2010-10-21 19:08:55 +0000
@@ -16,9 +16,9 @@
16First we create a view that will provoke a TimeoutError, a view for the16First we create a view that will provoke a TimeoutError, a view for the
17exception, and a time machine.17exception, and a time machine.
1818
19 >>> from zope.publisher.browser import BrowserView
20 >>> from zope.testbrowser.testing import Browser
19 >>> from textwrap import dedent21 >>> from textwrap import dedent
20 >>> from zope.testbrowser.testing import Browser
21 >>> from zope.publisher.browser import BrowserView
22 >>> from zope.publisher.interfaces.browser import (22 >>> from zope.publisher.interfaces.browser import (
23 ... IBrowserRequest, IBrowserView, IBrowserPublisher)23 ... IBrowserRequest, IBrowserView, IBrowserPublisher)
24 >>> from zope.interface import Interface, implements24 >>> from zope.interface import Interface, implements
2525
=== modified file 'lib/canonical/launchpad/webapp/tests/test_preferredcharsets.txt'
--- lib/canonical/launchpad/webapp/tests/test_preferredcharsets.txt 2006-07-14 14:45:31 +0000
+++ lib/canonical/launchpad/webapp/tests/test_preferredcharsets.txt 2010-10-21 19:08:55 +0000
@@ -1,8 +1,8 @@
1We have a custom IUserPreferredCharsets which always returns1We have a custom IUserPreferredCharsets which always returns
2utf-8 as the preferred charset.2utf-8 as the preferred charset.
33
4 >>> from zope.publisher.browser import TestRequest
4 >>> from canonical.launchpad.webapp import Utf8PreferredCharsets5 >>> from canonical.launchpad.webapp import Utf8PreferredCharsets
5 >>> from zope.publisher.browser import TestRequest
6 >>> user_preferred = Utf8PreferredCharsets(TestRequest())6 >>> user_preferred = Utf8PreferredCharsets(TestRequest())
77
8 >>> from zope.i18n.interfaces import IUserPreferredCharsets8 >>> from zope.i18n.interfaces import IUserPreferredCharsets
99
=== modified file 'lib/canonical/launchpad/webapp/tests/test_request_expire_render.txt'
--- lib/canonical/launchpad/webapp/tests/test_request_expire_render.txt 2010-09-13 04:45:59 +0000
+++ lib/canonical/launchpad/webapp/tests/test_request_expire_render.txt 2010-10-21 19:08:55 +0000
@@ -12,8 +12,8 @@
12since get_request_remaining_seconds will raise. However, if the user is logged12since get_request_remaining_seconds will raise. However, if the user is logged
13in, a query will be issued to render the "Logged in as No Privileges Person".13in, a query will be issued to render the "Logged in as No Privileges Person".
1414
15 >>> from canonical.config import config
15 >>> from textwrap import dedent16 >>> from textwrap import dedent
16 >>> from canonical.config import config
17 >>> test_data = dedent("""17 >>> test_data = dedent("""
18 ... [database]18 ... [database]
19 ... db_statement_timeout: 1000019 ... db_statement_timeout: 10000
2020
=== modified file 'lib/canonical/lazr/doc/menus.txt'
--- lib/canonical/lazr/doc/menus.txt 2010-09-28 19:10:51 +0000
+++ lib/canonical/lazr/doc/menus.txt 2010-10-21 19:08:55 +0000
@@ -76,8 +76,8 @@
76 # objects. This function does most of the work, but views must be76 # objects. This function does most of the work, but views must be
77 # assigned to the _last_obj_traversed attribute.77 # assigned to the _last_obj_traversed attribute.
7878
79 >>> from canonical.launchpad.webapp import canonical_url
79 >>> from canonical.lazr.testing.menus import make_fake_request80 >>> from canonical.lazr.testing.menus import make_fake_request
80 >>> from canonical.launchpad.webapp import canonical_url
8181
82 >>> root = Root('', None)82 >>> root = Root('', None)
83 >>> cookbook = Cookbook('joy-of-cooking', root)83 >>> cookbook = Cookbook('joy-of-cooking', root)
@@ -932,8 +932,8 @@
932 >>> from zope.traversing.adapters import DefaultTraversable932 >>> from zope.traversing.adapters import DefaultTraversable
933 >>> from zope.traversing.interfaces import IPathAdapter, ITraversable933 >>> from zope.traversing.interfaces import IPathAdapter, ITraversable
934 >>> from canonical.launchpad.ftests import test_tales934 >>> from canonical.launchpad.ftests import test_tales
935 >>> from canonical.lazr.testing.menus import summarise_tal_links
935 >>> from lp.app.browser.tales import MenuAPI936 >>> from lp.app.browser.tales import MenuAPI
936 >>> from canonical.lazr.testing.menus import summarise_tal_links
937937
938 # MenuAPI is normally registered as an IPathAdapter in ZCML. This938 # MenuAPI is normally registered as an IPathAdapter in ZCML. This
939 # approximates what is done by the code:939 # approximates what is done by the code:
940940
=== modified file 'lib/canonical/lazr/doc/timeout.txt'
--- lib/canonical/lazr/doc/timeout.txt 2010-04-22 18:53:09 +0000
+++ lib/canonical/lazr/doc/timeout.txt 2010-10-21 19:08:55 +0000
@@ -10,8 +10,8 @@
10The time to wait can be passed using the timeout parameter to the10The time to wait can be passed using the timeout parameter to the
11decorator.11decorator.
1212
13 >>> from canonical.lazr.timeout import with_timeout
13 >>> from select import select14 >>> from select import select
14 >>> from canonical.lazr.timeout import with_timeout
1515
16 >>> @with_timeout(timeout=0.5)16 >>> @with_timeout(timeout=0.5)
17 ... def wait_for(time):17 ... def wait_for(time):
1818
=== modified file 'lib/lp/answers/browser/tests/views.txt'
--- lib/lp/answers/browser/tests/views.txt 2010-07-30 12:56:27 +0000
+++ lib/lp/answers/browser/tests/views.txt 2010-10-21 19:08:55 +0000
@@ -100,8 +100,8 @@
100100
101 # Setup a harness to easily test the view.101 # Setup a harness to easily test the view.
102102
103 >>> from canonical.launchpad.ftests import LaunchpadFormHarness
104 >>> from canonical.launchpad.browser import QuestionWorkflowView103 >>> from canonical.launchpad.browser import QuestionWorkflowView
104 >>> from canonical.launchpad.ftests import LaunchpadFormHarness
105 >>> workflow_harness = LaunchpadFormHarness(105 >>> workflow_harness = LaunchpadFormHarness(
106 ... firefox_question, QuestionWorkflowView)106 ... firefox_question, QuestionWorkflowView)
107107
@@ -708,8 +708,8 @@
708retrieve the set of languages in which the user is assumed to be708retrieve the set of languages in which the user is assumed to be
709interested.709interested.
710710
711 >>> from canonical.launchpad.browser import UserSupportLanguagesMixin
711 >>> from canonical.launchpad.webapp import LaunchpadView712 >>> from canonical.launchpad.webapp import LaunchpadView
712 >>> from canonical.launchpad.browser import UserSupportLanguagesMixin
713713
714 >>> class UserSupportLanguagesView(UserSupportLanguagesMixin,714 >>> class UserSupportLanguagesView(UserSupportLanguagesMixin,
715 ... LaunchpadView):715 ... LaunchpadView):
716716
=== modified file 'lib/lp/answers/doc/emailinterface.txt.disabled'
--- lib/lp/answers/doc/emailinterface.txt.disabled 2010-10-04 19:50:45 +0000
+++ lib/lp/answers/doc/emailinterface.txt.disabled 2010-10-21 19:08:55 +0000
@@ -98,17 +98,17 @@
98 # be the question owner and Sample Person who will play the role of98 # be the question owner and Sample Person who will play the role of
99 # answer contact. Foo Bar is used to change the status of the99 # answer contact. Foo Bar is used to change the status of the
100 # question.100 # question.
101 >>> from lp.registry.interfaces.distribution import IDistributionSet
101 >>> from lp.registry.interfaces.person import IPersonSet102 >>> from lp.registry.interfaces.person import IPersonSet
102 >>> from lp.registry.interfaces.distribution import IDistributionSet
103 >>> login('no-priv@canonical.com')103 >>> login('no-priv@canonical.com')
104 >>> personset = getUtility(IPersonSet)104 >>> personset = getUtility(IPersonSet)
105 >>> sample_person = personset.getByEmail('test@canonical.com')105 >>> sample_person = personset.getByEmail('test@canonical.com')
106 >>> no_priv = personset.getByEmail('no-priv@canonical.com')106 >>> no_priv = personset.getByEmail('no-priv@canonical.com')
107 >>> foo_bar = personset.getByEmail('foo.bar@canonical.com')107 >>> foo_bar = personset.getByEmail('foo.bar@canonical.com')
108108
109 >>> from canonical.testing.layers import LaunchpadZopelessLayer
110 >>> from canonical.config import config109 >>> from canonical.config import config
111 >>> from canonical.database.sqlbase import commit110 >>> from canonical.database.sqlbase import commit
111 >>> from canonical.testing.layers import LaunchpadZopelessLayer
112112
113 >>> LaunchpadZopelessLayer.switchDbUser('launchpad')113 >>> LaunchpadZopelessLayer.switchDbUser('launchpad')
114 >>> ubuntu = getUtility(IDistributionSet)['ubuntu']114 >>> ubuntu = getUtility(IDistributionSet)['ubuntu']
115115
=== modified file 'lib/lp/answers/doc/expiration.txt'
--- lib/lp/answers/doc/expiration.txt 2010-07-30 12:56:27 +0000
+++ lib/lp/answers/doc/expiration.txt 2010-10-21 19:08:55 +0000
@@ -19,8 +19,8 @@
1919
20 # Sanity check in case somebody modifies the question sampledata and20 # Sanity check in case somebody modifies the question sampledata and
21 # forget to update this script.21 # forget to update this script.
22 >>> from lp.answers.interfaces.questionenums import QuestionStatus
22 >>> from lp.answers.model.question import Question23 >>> from lp.answers.model.question import Question
23 >>> from lp.answers.interfaces.questionenums import QuestionStatus
24 >>> Question.select('status IN (%i,%i)' % (24 >>> Question.select('status IN (%i,%i)' % (
25 ... QuestionStatus.OPEN.value,25 ... QuestionStatus.OPEN.value,
26 ... QuestionStatus.NEEDSINFO.value)).count()26 ... QuestionStatus.NEEDSINFO.value)).count()
@@ -43,8 +43,8 @@
43 >>> two_weeks_ago = now - timedelta(days=14)43 >>> two_weeks_ago = now - timedelta(days=14)
44 >>> a_month_ago = now - timedelta(days=31)44 >>> a_month_ago = now - timedelta(days=31)
45 >>> from canonical.launchpad.webapp.interfaces import ILaunchBag45 >>> from canonical.launchpad.webapp.interfaces import ILaunchBag
46 >>> from lp.answers.interfaces.questioncollection import IQuestionSet
46 >>> from lp.registry.interfaces.person import IPersonSet47 >>> from lp.registry.interfaces.person import IPersonSet
47 >>> from lp.answers.interfaces.questioncollection import IQuestionSet
48 >>> login('no-priv@canonical.com')48 >>> login('no-priv@canonical.com')
49 >>> no_priv = getUtility(ILaunchBag).user49 >>> no_priv = getUtility(ILaunchBag).user
5050
5151
=== modified file 'lib/lp/answers/doc/faq-vocabulary.txt'
--- lib/lp/answers/doc/faq-vocabulary.txt 2010-08-02 02:33:53 +0000
+++ lib/lp/answers/doc/faq-vocabulary.txt 2010-10-21 19:08:55 +0000
@@ -4,10 +4,10 @@
4collection. It provides the IHugeVocabulary interface.4collection. It provides the IHugeVocabulary interface.
55
6 >>> from zope.component import getUtility6 >>> from zope.component import getUtility
7 >>> from lp.registry.interfaces.product import IProductSet7 >>> from zope.schema.vocabulary import getVocabularyRegistry
8 >>> from canonical.launchpad.webapp.testing import verifyObject8 >>> from canonical.launchpad.webapp.testing import verifyObject
9 >>> from canonical.launchpad.webapp.vocabulary import IHugeVocabulary9 >>> from canonical.launchpad.webapp.vocabulary import IHugeVocabulary
10 >>> from zope.schema.vocabulary import getVocabularyRegistry10 >>> from lp.registry.interfaces.product import IProductSet
1111
12 >>> vocabulary_registry = getVocabularyRegistry()12 >>> vocabulary_registry = getVocabularyRegistry()
13 >>> firefox = getUtility(IProductSet).getByName('firefox')13 >>> firefox = getUtility(IProductSet).getByName('firefox')
1414
=== modified file 'lib/lp/answers/doc/faq.txt'
--- lib/lp/answers/doc/faq.txt 2010-07-30 12:56:27 +0000
+++ lib/lp/answers/doc/faq.txt 2010-10-21 19:08:55 +0000
@@ -10,12 +10,12 @@
10are associated to distributions or products. The IFAQTarget interface is10are associated to distributions or products. The IFAQTarget interface is
11provided by objects that can host FAQs.11provided by objects that can host FAQs.
1212
13 >>> from zope.security.proxy import removeSecurityProxy
13 >>> from canonical.launchpad.webapp.testing import verifyObject14 >>> from canonical.launchpad.webapp.testing import verifyObject
14 >>> from zope.security.proxy import removeSecurityProxy
1515
16 >>> from lp.answers.interfaces.faqtarget import IFAQTarget
16 >>> from lp.registry.interfaces.distribution import IDistributionSet17 >>> from lp.registry.interfaces.distribution import IDistributionSet
17 >>> from lp.registry.interfaces.product import IProductSet18 >>> from lp.registry.interfaces.product import IProductSet
18 >>> from lp.answers.interfaces.faqtarget import IFAQTarget
1919
20 >>> firefox = getUtility(IProductSet).getByName('firefox')20 >>> firefox = getUtility(IProductSet).getByName('firefox')
2121
2222
=== modified file 'lib/lp/answers/doc/faqtarget.txt'
--- lib/lp/answers/doc/faqtarget.txt 2010-10-03 15:30:06 +0000
+++ lib/lp/answers/doc/faqtarget.txt 2010-10-21 19:08:55 +0000
@@ -31,8 +31,8 @@
31the target.31the target.
3232
33 >>> login('no-priv@canonical.com')33 >>> login('no-priv@canonical.com')
34 >>> from canonical.launchpad.webapp.interfaces import ILaunchBag
35 >>> from canonical.launchpad.webapp.authorization import check_permission34 >>> from canonical.launchpad.webapp.authorization import check_permission
35 >>> from canonical.launchpad.webapp.interfaces import ILaunchBag
36 >>> check_permission('launchpad.Append', target)36 >>> check_permission('launchpad.Append', target)
37 False37 False
3838
3939
=== modified file 'lib/lp/answers/doc/notifications.txt'
--- lib/lp/answers/doc/notifications.txt 2010-07-30 12:56:27 +0000
+++ lib/lp/answers/doc/notifications.txt 2010-10-21 19:08:55 +0000
@@ -83,8 +83,8 @@
83Register the Ubuntu Team as Ubuntu's answer contact, so that they get83Register the Ubuntu Team as Ubuntu's answer contact, so that they get
84notified about the changes as well:84notified about the changes as well:
8585
86 >>> from lp.services.worlddata.interfaces.language import ILanguageSet
87 >>> from lp.registry.interfaces.person import IPersonSet86 >>> from lp.registry.interfaces.person import IPersonSet
87 >>> from lp.services.worlddata.interfaces.language import ILanguageSet
88 >>> ubuntu_team = getUtility(IPersonSet).getByName('ubuntu-team')88 >>> ubuntu_team = getUtility(IPersonSet).getByName('ubuntu-team')
89 >>> ubuntu_team.addLanguage(getUtility(ILanguageSet)['en'])89 >>> ubuntu_team.addLanguage(getUtility(ILanguageSet)['en'])
90 >>> ubuntu.addAnswerContact(ubuntu_team)90 >>> ubuntu.addAnswerContact(ubuntu_team)
@@ -103,9 +103,9 @@
103If we edit the title and description of the question, a notification103If we edit the title and description of the question, a notification
104will be sent.104will be sent.
105105
106 >>> from zope.interface import providedBy
106 >>> from lazr.lifecycle.event import ObjectModifiedEvent107 >>> from lazr.lifecycle.event import ObjectModifiedEvent
107 >>> from lazr.lifecycle.snapshot import Snapshot108 >>> from lazr.lifecycle.snapshot import Snapshot
108 >>> from zope.interface import providedBy
109109
110 >>> login('no-priv@canonical.com')110 >>> login('no-priv@canonical.com')
111 >>> no_priv = getUtility(ILaunchBag).user111 >>> no_priv = getUtility(ILaunchBag).user
112112
=== modified file 'lib/lp/answers/doc/person.txt'
--- lib/lp/answers/doc/person.txt 2010-06-09 17:07:49 +0000
+++ lib/lp/answers/doc/person.txt 2010-10-21 19:08:55 +0000
@@ -14,8 +14,8 @@
14commented on, or answered. Various subsets can be selected by using the14commented on, or answered. Various subsets can be selected by using the
15various search criteria.15various search criteria.
1616
17 >>> from lp.answers.interfaces.questionsperson import IQuestionsPerson
17 >>> from lp.registry.interfaces.person import IPersonSet18 >>> from lp.registry.interfaces.person import IPersonSet
18 >>> from lp.answers.interfaces.questionsperson import IQuestionsPerson
19 >>> personset = getUtility(IPersonSet)19 >>> personset = getUtility(IPersonSet)
20 >>> foo_bar_raw = personset.getByEmail('foo.bar@canonical.com')20 >>> foo_bar_raw = personset.getByEmail('foo.bar@canonical.com')
21 >>> foo_bar = IQuestionsPerson(foo_bar_raw)21 >>> foo_bar = IQuestionsPerson(foo_bar_raw)
2222
=== modified file 'lib/lp/answers/doc/projectgroup.txt'
--- lib/lp/answers/doc/projectgroup.txt 2010-07-30 12:56:27 +0000
+++ lib/lp/answers/doc/projectgroup.txt 2010-10-21 19:08:55 +0000
@@ -24,8 +24,8 @@
24You can search for all questions filed against projects in a project using the24You can search for all questions filed against projects in a project using the
25project group's searchQuestions() method.25project group's searchQuestions() method.
2626
27 >>> from lp.registry.interfaces.person import IPersonSet
27 >>> from lp.registry.interfaces.product import IProductSet28 >>> from lp.registry.interfaces.product import IProductSet
28 >>> from lp.registry.interfaces.person import IPersonSet
2929
30 >>> login('test@canonical.com')30 >>> login('test@canonical.com')
31 >>> thunderbird = getUtility(IProductSet).getByName('thunderbird')31 >>> thunderbird = getUtility(IProductSet).getByName('thunderbird')
3232
=== modified file 'lib/lp/answers/doc/question.txt'
--- lib/lp/answers/doc/question.txt 2010-10-03 15:30:06 +0000
+++ lib/lp/answers/doc/question.txt 2010-10-21 19:08:55 +0000
@@ -11,9 +11,9 @@
11 >>> login('test@canonical.com')11 >>> login('test@canonical.com')
1212
13 >>> from canonical.launchpad.webapp.testing import verifyObject13 >>> from canonical.launchpad.webapp.testing import verifyObject
14 >>> from lp.answers.interfaces.questiontarget import IQuestionTarget
15 >>> from lp.registry.interfaces.distribution import IDistributionSet
14 >>> from lp.registry.interfaces.person import IPersonSet16 >>> from lp.registry.interfaces.person import IPersonSet
15 >>> from lp.registry.interfaces.distribution import IDistributionSet
16 >>> from lp.answers.interfaces.questiontarget import IQuestionTarget
17 >>> from lp.registry.interfaces.product import IProductSet17 >>> from lp.registry.interfaces.product import IProductSet
1818
19 >>> firefox = getUtility(IProductSet)['firefox']19 >>> firefox = getUtility(IProductSet)['firefox']
@@ -86,8 +86,8 @@
8686
87Questions are manipulated through the IQuestion interface.87Questions are manipulated through the IQuestion interface.
8888
89 >>> from zope.security.proxy import removeSecurityProxy
89 >>> from lp.answers.interfaces.question import IQuestion90 >>> from lp.answers.interfaces.question import IQuestion
90 >>> from zope.security.proxy import removeSecurityProxy
9191
92 # The complete interface is not necessarily available to the92 # The complete interface is not necessarily available to the
93 # logged in user.93 # logged in user.
9494
=== modified file 'lib/lp/answers/doc/questionsets.txt'
--- lib/lp/answers/doc/questionsets.txt 2010-10-03 15:30:06 +0000
+++ lib/lp/answers/doc/questionsets.txt 2010-10-21 19:08:55 +0000
@@ -177,10 +177,10 @@
177177
178Then some recent questions are created on a number of projects.178Then some recent questions are created on a number of projects.
179179
180 >>> from lp.answers.testing import QuestionFactory
180 >>> from lp.registry.interfaces.distribution import IDistributionSet181 >>> from lp.registry.interfaces.distribution import IDistributionSet
181 >>> from lp.registry.interfaces.person import IPersonSet182 >>> from lp.registry.interfaces.person import IPersonSet
182 >>> from lp.registry.interfaces.product import IProductSet183 >>> from lp.registry.interfaces.product import IProductSet
183 >>> from lp.answers.testing import QuestionFactory
184184
185 >>> firefox = getUtility(IProductSet).getByName('firefox')185 >>> firefox = getUtility(IProductSet).getByName('firefox')
186 >>> landscape = getUtility(IProductSet).getByName('landscape')186 >>> landscape = getUtility(IProductSet).getByName('landscape')
187187
=== modified file 'lib/lp/answers/doc/questiontarget.txt'
--- lib/lp/answers/doc/questiontarget.txt 2010-10-03 15:30:06 +0000
+++ lib/lp/answers/doc/questiontarget.txt 2010-10-21 19:08:55 +0000
@@ -532,9 +532,9 @@
532copied to the question.532copied to the question.
533533
534 >>> from datetime import datetime534 >>> from datetime import datetime
535 >>> from pytz import UTC
536 >>> from lp.bugs.interfaces.bug import CreateBugParams535 >>> from lp.bugs.interfaces.bug import CreateBugParams
537 >>> from lp.registry.interfaces.product import IProductSet536 >>> from lp.registry.interfaces.product import IProductSet
537 >>> from pytz import UTC
538538
539 >>> now = datetime.now(UTC)539 >>> now = datetime.now(UTC)
540 >>> target = getUtility(IProductSet)['jokosher']540 >>> target = getUtility(IProductSet)['jokosher']
541541
=== modified file 'lib/lp/answers/doc/workflow.txt'
--- lib/lp/answers/doc/workflow.txt 2010-10-03 15:30:06 +0000
+++ lib/lp/answers/doc/workflow.txt 2010-10-21 19:08:55 +0000
@@ -602,8 +602,8 @@
602 # Register an event listener that will print events it receives.602 # Register an event listener that will print events it receives.
603 >>> from lazr.lifecycle.interfaces import (603 >>> from lazr.lifecycle.interfaces import (
604 ... IObjectCreatedEvent, IObjectModifiedEvent)604 ... IObjectCreatedEvent, IObjectModifiedEvent)
605 >>> from canonical.lazr.testing.event import TestEventListener
605 >>> from lp.answers.interfaces.question import IQuestion606 >>> from lp.answers.interfaces.question import IQuestion
606 >>> from canonical.lazr.testing.event import TestEventListener
607607
608 >>> def print_event(object, event):608 >>> def print_event(object, event):
609 ... print "Received %s on %s" % (609 ... print "Received %s on %s" % (
610610
=== modified file 'lib/lp/answers/stories/distribution-package-answer-contact.txt'
--- lib/lp/answers/stories/distribution-package-answer-contact.txt 2010-07-30 12:56:27 +0000
+++ lib/lp/answers/stories/distribution-package-answer-contact.txt 2010-10-21 19:08:55 +0000
@@ -7,10 +7,10 @@
7 # Register a Sample Person as an answer contact for the distribution.7 # Register a Sample Person as an answer contact for the distribution.
8 >>> from zope.component import getUtility8 >>> from zope.component import getUtility
9 >>> from canonical.launchpad.ftests import login, logout9 >>> from canonical.launchpad.ftests import login, logout
10 >>> from canonical.database.sqlbase import flush_database_updates
10 >>> from canonical.launchpad.webapp.interfaces import ILaunchBag11 >>> from canonical.launchpad.webapp.interfaces import ILaunchBag
12 >>> from lp.registry.interfaces.distribution import IDistributionSet
11 >>> from lp.services.worlddata.interfaces.language import ILanguageSet13 >>> from lp.services.worlddata.interfaces.language import ILanguageSet
12 >>> from lp.registry.interfaces.distribution import IDistributionSet
13 >>> from canonical.database.sqlbase import flush_database_updates
14 >>> login('test@canonical.com')14 >>> login('test@canonical.com')
15 >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu')15 >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
16 >>> # Answer contacts must speak a language16 >>> # Answer contacts must speak a language
1717
=== modified file 'lib/lp/answers/tests/questiontarget-sourcepackage.txt'
--- lib/lp/answers/tests/questiontarget-sourcepackage.txt 2010-07-30 12:56:27 +0000
+++ lib/lp/answers/tests/questiontarget-sourcepackage.txt 2010-10-21 19:08:55 +0000
@@ -13,8 +13,8 @@
13of the DistributionSourcePackage (and not the SourcePackage):13of the DistributionSourcePackage (and not the SourcePackage):
1414
15 >>> login('no-priv@canonical.com')15 >>> login('no-priv@canonical.com')
16 >>> from lp.registry.interfaces.distribution import IDistributionSet
16 >>> from lp.registry.interfaces.person import IPersonSet17 >>> from lp.registry.interfaces.person import IPersonSet
17 >>> from lp.registry.interfaces.distribution import IDistributionSet
18 >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu')18 >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
19 >>> firefox = ubuntu.currentseries.getSourcePackage('mozilla-firefox')19 >>> firefox = ubuntu.currentseries.getSourcePackage('mozilla-firefox')
2020
2121
=== modified file 'lib/lp/app/browser/tests/base-layout.txt'
--- lib/lp/app/browser/tests/base-layout.txt 2010-09-29 03:26:01 +0000
+++ lib/lp/app/browser/tests/base-layout.txt 2010-10-21 19:08:55 +0000
@@ -10,9 +10,9 @@
10in the root element of the page template. The base layout template uses the10in the root element of the page template. The base layout template uses the
11YUI grid classes for positioning.11YUI grid classes for positioning.
1212
13 >>> from z3c.ptcompat import ViewPageTemplateFile
14 >>> from canonical.launchpad.webapp.publisher import LaunchpadView13 >>> from canonical.launchpad.webapp.publisher import LaunchpadView
15 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest14 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
15 >>> from z3c.ptcompat import ViewPageTemplateFile
1616
17 >>> user = factory.makePerson(name='waffles')17 >>> user = factory.makePerson(name='waffles')
18 >>> request = LaunchpadTestRequest(18 >>> request = LaunchpadTestRequest(
1919
=== modified file 'lib/lp/app/browser/tests/launchpadform-view.txt'
--- lib/lp/app/browser/tests/launchpadform-view.txt 2010-06-22 17:12:23 +0000
+++ lib/lp/app/browser/tests/launchpadform-view.txt 2010-10-21 19:08:55 +0000
@@ -6,15 +6,15 @@
6widget rendering is wrapped with a <div> using the widget_class, which6widget rendering is wrapped with a <div> using the widget_class, which
7can be used for subordinate field indentation, for example.7can be used for subordinate field indentation, for example.
88
9 >>> from z3c.ptcompat import ViewPageTemplateFile
10 >>> from zope.app.form.browser import TextWidget9 >>> from zope.app.form.browser import TextWidget
11 >>> from zope.interface import Interface10 >>> from zope.interface import Interface
12 >>> from zope.schema import TextLine11 >>> from zope.schema import TextLine
13 >>> from canonical.config import config12 >>> from canonical.config import config
13 >>> from z3c.ptcompat import ViewPageTemplateFile
14 >>> from canonical.launchpad.webapp.launchpadform import (14 >>> from canonical.launchpad.webapp.launchpadform import (
15 ... custom_widget, LaunchpadFormView)15 ... custom_widget, LaunchpadFormView)
16 >>> from canonical.launchpad.testing.pages import find_tags_by_class
16 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest17 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
17 >>> from canonical.launchpad.testing.pages import find_tags_by_class
1818
19 >>> class ITestSchema(Interface):19 >>> class ITestSchema(Interface):
20 ... displayname = TextLine(title=u"Title")20 ... displayname = TextLine(title=u"Title")
2121
=== modified file 'lib/lp/app/doc/tales.txt'
--- lib/lp/app/doc/tales.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/app/doc/tales.txt 2010-10-21 19:08:55 +0000
@@ -113,8 +113,8 @@
113113
114And finally Copy archives.114And finally Copy archives.
115115
116 >>> from lp.soyuz.enums import ArchivePurpose
116 >>> from lp.soyuz.interfaces.archive import IArchiveSet117 >>> from lp.soyuz.interfaces.archive import IArchiveSet
117 >>> from lp.soyuz.enums import ArchivePurpose
118 >>> copy = getUtility(IArchiveSet).new(118 >>> copy = getUtility(IArchiveSet).new(
119 ... owner=mark, purpose=ArchivePurpose.COPY,119 ... owner=mark, purpose=ArchivePurpose.COPY,
120 ... distribution=ubuntu, name='rebuild')120 ... distribution=ubuntu, name='rebuild')
@@ -197,8 +197,8 @@
197197
198The 'building' build is 14x14:198The 'building' build is 14x14:
199199
200 >>> from zope.security.proxy import removeSecurityProxy
200 >>> from lp.buildmaster.enums import BuildStatus201 >>> from lp.buildmaster.enums import BuildStatus
201 >>> from zope.security.proxy import removeSecurityProxy
202 >>> removeSecurityProxy(build).status = BuildStatus.BUILDING202 >>> removeSecurityProxy(build).status = BuildStatus.BUILDING
203 >>> print test_tales("build/image:icon", build=build)203 >>> print test_tales("build/image:icon", build=build)
204 <img width="14" height="14"...src="/@@/processing" />204 <img width="14" height="14"...src="/@@/processing" />
@@ -1181,8 +1181,8 @@
11811181
1182Test the 'fmt:url' namespace for canonical urls.1182Test the 'fmt:url' namespace for canonical urls.
11831183
1184 >>> from zope.interface import implements
1184 >>> from canonical.launchpad.webapp.interfaces import ICanonicalUrlData1185 >>> from canonical.launchpad.webapp.interfaces import ICanonicalUrlData
1185 >>> from zope.interface import implements
1186 >>> class ObjectThatHasUrl:1186 >>> class ObjectThatHasUrl:
1187 ... implements(ICanonicalUrlData)1187 ... implements(ICanonicalUrlData)
1188 ... path = 'bonobo/saki'1188 ... path = 'bonobo/saki'
11891189
=== modified file 'lib/lp/app/stories/basics/xx-beta-testers-redirection.txt'
--- lib/lp/app/stories/basics/xx-beta-testers-redirection.txt 2010-10-03 15:30:06 +0000
+++ lib/lp/app/stories/basics/xx-beta-testers-redirection.txt 2010-10-21 19:08:55 +0000
@@ -203,8 +203,8 @@
203Add Foo Bar to the beta team.203Add Foo Bar to the beta team.
204204
205 >>> from zope.component import getUtility205 >>> from zope.component import getUtility
206 >>> from canonical.launchpad.interfaces import (206 >>> from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities
207 ... ILaunchpadCelebrities, IPersonSet)207 >>> from lp.registry.interfaces.person import IPersonSet
208 >>> from canonical.launchpad.ftests import login, logout208 >>> from canonical.launchpad.ftests import login, logout
209 >>> login('foo.bar@canonical.com')209 >>> login('foo.bar@canonical.com')
210 >>> foo_bar = getUtility(IPersonSet).getByName('name16')210 >>> foo_bar = getUtility(IPersonSet).getByName('name16')
211211
=== modified file 'lib/lp/archivepublisher/tests/archive-signing.txt'
--- lib/lp/archivepublisher/tests/archive-signing.txt 2010-09-02 11:45:19 +0000
+++ lib/lp/archivepublisher/tests/archive-signing.txt 2010-10-21 19:08:55 +0000
@@ -32,8 +32,8 @@
32`IArchiveSet.getPPAsPendingSigningKey` allows call-sites to query for32`IArchiveSet.getPPAsPendingSigningKey` allows call-sites to query for
33PPA pending signing key generation.33PPA pending signing key generation.
3434
35 >>> from lp.registry.interfaces.person import IPersonSet
35 >>> from lp.soyuz.interfaces.archive import IArchiveSet36 >>> from lp.soyuz.interfaces.archive import IArchiveSet
36 >>> from lp.registry.interfaces.person import IPersonSet
3737
38Only PPAs with at least one source publication are considered.38Only PPAs with at least one source publication are considered.
3939
4040
=== modified file 'lib/lp/archivepublisher/tests/publishing-meta-data-files.txt'
--- lib/lp/archivepublisher/tests/publishing-meta-data-files.txt 2010-08-24 13:47:37 +0000
+++ lib/lp/archivepublisher/tests/publishing-meta-data-files.txt 2010-10-21 19:08:55 +0000
@@ -11,12 +11,12 @@
1111
12 >>> from canonical.launchpad.interfaces.librarian import (12 >>> from canonical.launchpad.interfaces.librarian import (
13 ... ILibraryFileAliasSet)13 ... ILibraryFileAliasSet)
14 >>> from cStringIO import StringIO
14 >>> from lp.archiveuploader.tests import mock_logger15 >>> from lp.archiveuploader.tests import mock_logger
15 >>> from lp.registry.interfaces.distribution import IDistributionSet16 >>> from lp.registry.interfaces.distribution import IDistributionSet
17 >>> from lp.soyuz.enums import PackageUploadCustomFormat
16 >>> from lp.soyuz.interfaces.publishing import PackagePublishingPocket18 >>> from lp.soyuz.interfaces.publishing import PackagePublishingPocket
17 >>> from lp.soyuz.enums import PackageUploadCustomFormat
18 >>> from lp.soyuz.model.queue import PackageUploadCustom19 >>> from lp.soyuz.model.queue import PackageUploadCustom
19 >>> from cStringIO import StringIO
2020
21 >>> bat = getUtility(IDistributionSet)['ubuntutest']['breezy-autotest']21 >>> bat = getUtility(IDistributionSet)['ubuntutest']['breezy-autotest']
22 >>> ppa = factory.makeArchive(distribution=bat.distribution)22 >>> ppa = factory.makeArchive(distribution=bat.distribution)
2323
=== modified file 'lib/lp/archiveuploader/tests/nascentupload-announcements.txt'
--- lib/lp/archiveuploader/tests/nascentupload-announcements.txt 2010-10-03 15:30:06 +0000
+++ lib/lp/archiveuploader/tests/nascentupload-announcements.txt 2010-10-21 19:08:55 +0000
@@ -52,8 +52,9 @@
52distroseries so that we can upload to it. Also adjust 'changeslist'52distroseries so that we can upload to it. Also adjust 'changeslist'
53address and allow uploads to universe:53address and allow uploads to universe:
5454
55 >>> from canonical.launchpad.interfaces import (55 >>> from canonical.launchpad.interfaces.librarian import ILibraryFileAliasSet
56 ... SeriesStatus, IDistributionSet, ILibraryFileAliasSet)56 >>> from lp.registry.interfaces.distribution import IDistributionSet
57 >>> from lp.registry.interfaces.series import SeriesStatus
57 >>> ubuntu = getUtility(IDistributionSet)['ubuntu']58 >>> ubuntu = getUtility(IDistributionSet)['ubuntu']
58 >>> hoary = ubuntu['hoary']59 >>> hoary = ubuntu['hoary']
59 >>> hoary.status = SeriesStatus.DEVELOPMENT60 >>> hoary.status = SeriesStatus.DEVELOPMENT
@@ -249,10 +250,10 @@
249250
250A PPA upload will contain the X-Launchpad-PPA header.251A PPA upload will contain the X-Launchpad-PPA header.
251252
253 >>> from lp.registry.interfaces.distribution import IDistributionSet
254 >>> from lp.registry.interfaces.person import IPersonSet
252 >>> from lp.soyuz.enums import ArchivePurpose255 >>> from lp.soyuz.enums import ArchivePurpose
253 >>> from lp.soyuz.interfaces.archive import IArchiveSet256 >>> from lp.soyuz.interfaces.archive import IArchiveSet
254 >>> from lp.registry.interfaces.distribution import IDistributionSet
255 >>> from lp.registry.interfaces.person import IPersonSet
256257
257 >>> ubuntu = getUtility(IDistributionSet)['ubuntu']258 >>> ubuntu = getUtility(IDistributionSet)['ubuntu']
258 >>> name16 = getUtility(IPersonSet).getByName('name16')259 >>> name16 = getUtility(IPersonSet).getByName('name16')
259260
=== modified file 'lib/lp/archiveuploader/tests/nascentupload-closing-bugs.txt'
--- lib/lp/archiveuploader/tests/nascentupload-closing-bugs.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/archiveuploader/tests/nascentupload-closing-bugs.txt 2010-10-21 19:08:55 +0000
@@ -32,8 +32,9 @@
3232
33 >>> from canonical.testing.layers import LaunchpadZopelessLayer33 >>> from canonical.testing.layers import LaunchpadZopelessLayer
34 >>> from lp.bugs.interfaces.bug import IBugSet34 >>> from lp.bugs.interfaces.bug import IBugSet
35 >>> from canonical.launchpad.interfaces import (35 >>> from lp.bugs.interfaces.bugtask import IBugTaskSet
36 ... IBugTaskSet, IDistributionSet, IPersonSet)36 >>> from lp.registry.interfaces.distribution import IDistributionSet
37 >>> from lp.registry.interfaces.person import IPersonSet
37 >>> login('no-priv@canonical.com')38 >>> login('no-priv@canonical.com')
38 >>> LaunchpadZopelessLayer.switchDbUser('launchpad')39 >>> LaunchpadZopelessLayer.switchDbUser('launchpad')
3940
4041
=== modified file 'lib/lp/archiveuploader/tests/nascentupload-packageset.txt'
--- lib/lp/archiveuploader/tests/nascentupload-packageset.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/archiveuploader/tests/nascentupload-packageset.txt 2010-10-21 19:08:55 +0000
@@ -4,11 +4,12 @@
4 >>> from lp.archiveuploader.tests import (4 >>> from lp.archiveuploader.tests import (
5 ... datadir, getPolicy, mock_logger_quiet)5 ... datadir, getPolicy, mock_logger_quiet)
6 >>> from canonical.database.sqlbase import commit6 >>> from canonical.database.sqlbase import commit
7 >>> from canonical.testing.layers import LaunchpadZopelessLayer
8 >>> from lp.registry.interfaces.person import IPersonSet
9 >>> from lp.registry.interfaces.sourcepackagename import ISourcePackageNameSet
7 >>> from lp.soyuz.enums import ArchivePermissionType10 >>> from lp.soyuz.enums import ArchivePermissionType
8 >>> from canonical.launchpad.interfaces import (11 >>> from lp.soyuz.interfaces.archivepermission import IArchivePermissionSet
9 ... IArchivePermissionSet, IPackagesetSet,12 >>> from lp.soyuz.interfaces.packageset import IPackagesetSet
10 ... IPersonSet, ISourcePackageNameSet)
11 >>> from canonical.testing.layers import LaunchpadZopelessLayer
1213
13 >>> insecure_policy = getPolicy(14 >>> insecure_policy = getPolicy(
14 ... name='insecure', distro='ubuntu', distroseries='hoary')15 ... name='insecure', distro='ubuntu', distroseries='hoary')
1516
=== modified file 'lib/lp/archiveuploader/tests/nascentupload.txt'
--- lib/lp/archiveuploader/tests/nascentupload.txt 2010-10-19 09:00:29 +0000
+++ lib/lp/archiveuploader/tests/nascentupload.txt 2010-10-21 19:08:55 +0000
@@ -12,8 +12,8 @@
12For the purpose of this test, hoary needs to be an open (development)12For the purpose of this test, hoary needs to be an open (development)
13distroseries so that we can upload to it.13distroseries so that we can upload to it.
1414
15 >>> from canonical.launchpad.interfaces import (15 >>> from lp.registry.interfaces.distribution import IDistributionSet
16 ... SeriesStatus, IDistributionSet)16 >>> from lp.registry.interfaces.series import SeriesStatus
17 >>> ubuntu = getUtility(IDistributionSet)['ubuntu']17 >>> ubuntu = getUtility(IDistributionSet)['ubuntu']
18 >>> hoary = ubuntu['hoary']18 >>> hoary = ubuntu['hoary']
19 >>> hoary.status = SeriesStatus.DEVELOPMENT19 >>> hoary.status = SeriesStatus.DEVELOPMENT
@@ -740,8 +740,8 @@
740 False740 False
741741
742 >>> from canonical.launchpad.webapp.testing import verifyObject742 >>> from canonical.launchpad.webapp.testing import verifyObject
743 >>> from canonical.launchpad.interfaces import (743 >>> from lp.registry.interfaces.gpg import IGPGKey
744 ... IGPGKey, IPersonSet)744 >>> from lp.registry.interfaces.person import IPersonSet
745745
746 >>> verifyObject(IGPGKey, bar_ok.changes.dsc.signingkey)746 >>> verifyObject(IGPGKey, bar_ok.changes.dsc.signingkey)
747 True747 True
@@ -815,8 +815,8 @@
815815
816 >>> commit()816 >>> commit()
817 >>> LaunchpadZopelessLayer.switchDbUser('launchpad')817 >>> LaunchpadZopelessLayer.switchDbUser('launchpad')
818 >>> from lp.registry.interfaces.sourcepackagename import ISourcePackageNameSet
818 >>> from lp.soyuz.enums import ArchivePermissionType819 >>> from lp.soyuz.enums import ArchivePermissionType
819 >>> from lp.registry.interfaces.sourcepackagename import ISourcePackageNameSet
820 >>> bar_name = getUtility(ISourcePackageNameSet).getOrCreateByName("bar")820 >>> bar_name = getUtility(ISourcePackageNameSet).getOrCreateByName("bar")
821 >>> discard = ArchivePermission(821 >>> discard = ArchivePermission(
822 ... archive=ubuntu.main_archive, person=name16,822 ... archive=ubuntu.main_archive, person=name16,
823823
=== modified file 'lib/lp/archiveuploader/tests/upload-karma.txt'
--- lib/lp/archiveuploader/tests/upload-karma.txt 2010-10-10 15:39:28 +0000
+++ lib/lp/archiveuploader/tests/upload-karma.txt 2010-10-21 19:08:55 +0000
@@ -49,9 +49,9 @@
4949
50Poke the queue entry so it looks like Foo Bar (name16) uploaded it:50Poke the queue entry so it looks like Foo Bar (name16) uploaded it:
5151
52 >>> from zope.security.proxy import removeSecurityProxy
52 >>> from lp.registry.interfaces.gpg import IGPGKeySet53 >>> from lp.registry.interfaces.gpg import IGPGKeySet
53 >>> from lp.registry.interfaces.person import IPersonSet54 >>> from lp.registry.interfaces.person import IPersonSet
54 >>> from zope.security.proxy import removeSecurityProxy
55 >>> name16 = getUtility(IPersonSet).getByName('name16')55 >>> name16 = getUtility(IPersonSet).getByName('name16')
56 >>> key = getUtility(IGPGKeySet).getGPGKeysForPeople([name16])[0]56 >>> key = getUtility(IGPGKeySet).getGPGKeysForPeople([name16])[0]
57 >>> removeSecurityProxy(foo_src.queue_root).signing_key = key57 >>> removeSecurityProxy(foo_src.queue_root).signing_key = key
@@ -83,9 +83,9 @@
83will generate another different karma event for the uploader.83will generate another different karma event for the uploader.
8484
85 >>> from lp.archiveuploader.tests import getPolicy85 >>> from lp.archiveuploader.tests import getPolicy
86 >>> from lp.registry.interfaces.distribution import IDistributionSet
86 >>> from lp.soyuz.enums import ArchivePurpose87 >>> from lp.soyuz.enums import ArchivePurpose
87 >>> from lp.soyuz.interfaces.archive import IArchiveSet88 >>> from lp.soyuz.interfaces.archive import IArchiveSet
88 >>> from lp.registry.interfaces.distribution import IDistributionSet
89 >>> ubuntu = getUtility(IDistributionSet)['ubuntu']89 >>> ubuntu = getUtility(IDistributionSet)['ubuntu']
90 >>> name16_ppa = getUtility(IArchiveSet).new(90 >>> name16_ppa = getUtility(IArchiveSet).new(
91 ... owner=name16, distribution=ubuntu, purpose=ArchivePurpose.PPA)91 ... owner=name16, distribution=ubuntu, purpose=ArchivePurpose.PPA)
9292
=== modified file 'lib/lp/archiveuploader/tests/uploadpolicy.txt'
--- lib/lp/archiveuploader/tests/uploadpolicy.txt 2010-10-06 11:46:51 +0000
+++ lib/lp/archiveuploader/tests/uploadpolicy.txt 2010-10-21 19:08:55 +0000
@@ -78,8 +78,8 @@
78approve an upload automatically (I.E. move it straight to ACCEPTED78approve an upload automatically (I.E. move it straight to ACCEPTED
79instead of UNAPPROVED)79instead of UNAPPROVED)
8080
81 >>> from canonical.launchpad.interfaces import (81 >>> from lp.registry.interfaces.distribution import IDistributionSet
82 ... SeriesStatus, IDistributionSet)82 >>> from lp.registry.interfaces.series import SeriesStatus
83 >>> ubuntu = getUtility(IDistributionSet)['ubuntu']83 >>> ubuntu = getUtility(IDistributionSet)['ubuntu']
84 >>> hoary = ubuntu['hoary']84 >>> hoary = ubuntu['hoary']
8585
8686
=== modified file 'lib/lp/blueprints/doc/spec-mail-exploder.txt'
--- lib/lp/blueprints/doc/spec-mail-exploder.txt 2010-10-12 14:03:44 +0000
+++ lib/lp/blueprints/doc/spec-mail-exploder.txt 2010-10-21 19:08:55 +0000
@@ -268,8 +268,8 @@
268 ... config.launchpad.specs_domain)268 ... config.launchpad.specs_domain)
269 >>> moin_change['Sender'] = 'webmaster@ubuntu.com'269 >>> moin_change['Sender'] = 'webmaster@ubuntu.com'
270270
271 >>> from lp.services.mail.incoming import handleMail
271 >>> from lp.services.mail.sendmail import sendmail272 >>> from lp.services.mail.sendmail import sendmail
272 >>> from lp.services.mail.incoming import handleMail
273 >>> sendmail(moin_change, bulk=False)273 >>> sendmail(moin_change, bulk=False)
274 '...'274 '...'
275275
276276
=== modified file 'lib/lp/blueprints/doc/specgraph.txt'
--- lib/lp/blueprints/doc/specgraph.txt 2010-07-30 12:56:27 +0000
+++ lib/lp/blueprints/doc/specgraph.txt 2010-10-21 19:08:55 +0000
@@ -256,8 +256,8 @@
256 >>> from zope.component import getMultiAdapter256 >>> from zope.component import getMultiAdapter
257 >>> from lp.blueprints.browser.specification import (257 >>> from lp.blueprints.browser.specification import (
258 ... SpecificationTreeImageTag)258 ... SpecificationTreeImageTag)
259 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
259 >>> from lp.registry.interfaces.product import IProductSet260 >>> from lp.registry.interfaces.product import IProductSet
260 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
261261
262 >>> firefox = getUtility(IProductSet).getByName('firefox')262 >>> firefox = getUtility(IProductSet).getByName('firefox')
263 >>> svg_support = firefox.getSpecification('svg-support')263 >>> svg_support = firefox.getSpecification('svg-support')
264264
=== modified file 'lib/lp/blueprints/doc/specification-branch.txt'
--- lib/lp/blueprints/doc/specification-branch.txt 2010-07-30 12:56:27 +0000
+++ lib/lp/blueprints/doc/specification-branch.txt 2010-10-21 19:08:55 +0000
@@ -14,8 +14,8 @@
14 >>> from zope.component import getUtility14 >>> from zope.component import getUtility
15 >>> from canonical.launchpad.interfaces.launchpad import (15 >>> from canonical.launchpad.interfaces.launchpad import (
16 ... ILaunchpadCelebrities)16 ... ILaunchpadCelebrities)
17 >>> from lp.code.interfaces.branchlookup import IBranchLookup
17 >>> from lp.registry.interfaces.person import IPersonSet18 >>> from lp.registry.interfaces.person import IPersonSet
18 >>> from lp.code.interfaces.branchlookup import IBranchLookup
1919
20 >>> ubuntu = getUtility(ILaunchpadCelebrities).ubuntu20 >>> ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
21 >>> spec = ubuntu.getSpecification('media-integrity-check')21 >>> spec = ubuntu.getSpecification('media-integrity-check')
2222
=== modified file 'lib/lp/blueprints/doc/specification-notifications.txt'
--- lib/lp/blueprints/doc/specification-notifications.txt 2010-07-30 12:56:27 +0000
+++ lib/lp/blueprints/doc/specification-notifications.txt 2010-10-21 19:08:55 +0000
@@ -8,8 +8,8 @@
8Changing the status:8Changing the status:
99
10 >>> from zope.component import getMultiAdapter10 >>> from zope.component import getMultiAdapter
11 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
11 >>> from lp.registry.interfaces.product import IProductSet12 >>> from lp.registry.interfaces.product import IProductSet
12 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
1313
14 >>> login('foo.bar@canonical.com')14 >>> login('foo.bar@canonical.com')
15 >>> firefox = getUtility(IProductSet).getByName('firefox')15 >>> firefox = getUtility(IProductSet).getByName('firefox')
1616
=== modified file 'lib/lp/blueprints/doc/specification.txt'
--- lib/lp/blueprints/doc/specification.txt 2010-07-30 12:56:27 +0000
+++ lib/lp/blueprints/doc/specification.txt 2010-10-21 19:08:55 +0000
@@ -117,9 +117,9 @@
117ISpecification.getDelta(). If there are no changes, None will be117ISpecification.getDelta(). If there are no changes, None will be
118returned:118returned:
119119
120 >>> from zope.interface import providedBy
121 >>> from lazr.lifecycle.snapshot import Snapshot
120 >>> from lp.bugs.interfaces.bug import IBugSet122 >>> from lp.bugs.interfaces.bug import IBugSet
121 >>> from lazr.lifecycle.snapshot import Snapshot
122 >>> from zope.interface import providedBy
123 >>> unmodified_spec = Snapshot(ubuspec, providing=providedBy(ubuspec))123 >>> unmodified_spec = Snapshot(ubuspec, providing=providedBy(ubuspec))
124 >>> ubuspec.getDelta(unmodified_spec, jdub) is None124 >>> ubuspec.getDelta(unmodified_spec, jdub) is None
125 True125 True
126126
=== modified file 'lib/lp/blueprints/doc/sprint-agenda.txt'
--- lib/lp/blueprints/doc/sprint-agenda.txt 2009-07-24 12:55:03 +0000
+++ lib/lp/blueprints/doc/sprint-agenda.txt 2010-10-21 19:08:55 +0000
@@ -9,8 +9,8 @@
9First, lets get hold of some people, a product, a sprint and a spec.9First, lets get hold of some people, a product, a sprint and a spec.
1010
11 >>> from lp.blueprints.model.sprint import SprintSet11 >>> from lp.blueprints.model.sprint import SprintSet
12 >>> from lp.registry.model.person import PersonSet
12 >>> from lp.registry.model.product import ProductSet13 >>> from lp.registry.model.product import ProductSet
13 >>> from lp.registry.model.person import PersonSet
14 >>> upstream_firefox = ProductSet()['firefox']14 >>> upstream_firefox = ProductSet()['firefox']
15 >>> canvas = upstream_firefox.getSpecification('canvas')15 >>> canvas = upstream_firefox.getSpecification('canvas')
16 >>> guacamole = SprintSet()['uds-guacamole']16 >>> guacamole = SprintSet()['uds-guacamole']
1717
=== modified file 'lib/lp/blueprints/doc/sprint-meeting-export.txt'
--- lib/lp/blueprints/doc/sprint-meeting-export.txt 2010-07-30 12:56:27 +0000
+++ lib/lp/blueprints/doc/sprint-meeting-export.txt 2010-10-21 19:08:55 +0000
@@ -13,10 +13,10 @@
13 >>> from pytz import timezone13 >>> from pytz import timezone
14 >>> from zope.component import getUtility, getMultiAdapter14 >>> from zope.component import getUtility, getMultiAdapter
15 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest15 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
16 >>> from lp.blueprints.browser.sprint import SprintMeetingExportView
17 >>> from lp.blueprints.interfaces.sprint import ISprintSet
16 >>> from lp.registry.interfaces.person import IPersonSet18 >>> from lp.registry.interfaces.person import IPersonSet
17 >>> from lp.registry.interfaces.product import IProductSet19 >>> from lp.registry.interfaces.product import IProductSet
18 >>> from lp.blueprints.interfaces.sprint import ISprintSet
19 >>> from lp.blueprints.browser.sprint import SprintMeetingExportView
2020
21Look up a few Launchpad objects to be used in the tests21Look up a few Launchpad objects to be used in the tests
2222
2323
=== modified file 'lib/lp/blueprints/doc/sprint.txt'
--- lib/lp/blueprints/doc/sprint.txt 2010-07-30 12:56:27 +0000
+++ lib/lp/blueprints/doc/sprint.txt 2010-10-21 19:08:55 +0000
@@ -4,8 +4,8 @@
4Sprints or meetings can be coordinated using Launchpad.4Sprints or meetings can be coordinated using Launchpad.
55
6 >>> from zope.component import getUtility6 >>> from zope.component import getUtility
7 >>> from lp.blueprints.interfaces.sprint import ISprintSet
7 >>> from lp.registry.interfaces.person import IPersonSet8 >>> from lp.registry.interfaces.person import IPersonSet
8 >>> from lp.blueprints.interfaces.sprint import ISprintSet
9 >>> sprintset = getUtility(ISprintSet)9 >>> sprintset = getUtility(ISprintSet)
1010
11To find a sprint by name, use:11To find a sprint by name, use:
@@ -15,9 +15,9 @@
15The major pillars, product, distribution and project, have some15The major pillars, product, distribution and project, have some
16properties which give us the sprints relevant to them.16properties which give us the sprints relevant to them.
1717
18 >>> from lp.registry.interfaces.distribution import IDistributionSet
18 >>> from lp.registry.interfaces.product import IProductSet19 >>> from lp.registry.interfaces.product import IProductSet
19 >>> from lp.registry.interfaces.projectgroup import IProjectGroupSet20 >>> from lp.registry.interfaces.projectgroup import IProjectGroupSet
20 >>> from lp.registry.interfaces.distribution import IDistributionSet
2121
22 >>> productset = getUtility(IProductSet)22 >>> productset = getUtility(IProductSet)
23 >>> projectset = getUtility(IProjectGroupSet)23 >>> projectset = getUtility(IProjectGroupSet)
@@ -156,8 +156,8 @@
156156
157Inactive products are excluded from the listings.157Inactive products are excluded from the listings.
158158
159 >>> from lp.registry.interfaces.product import IProductSet
160 >>> from canonical.launchpad.ftests import login159 >>> from canonical.launchpad.ftests import login
160 >>> from lp.registry.interfaces.product import IProductSet
161161
162 >>> firefox = getUtility(IProductSet).getByName('firefox')162 >>> firefox = getUtility(IProductSet).getByName('firefox')
163 >>> login("foo.bar@canonical.com")163 >>> login("foo.bar@canonical.com")
164164
=== modified file 'lib/lp/blueprints/stories/sprints/20-sprint-registration.txt'
--- lib/lp/blueprints/stories/sprints/20-sprint-registration.txt 2010-07-30 12:56:27 +0000
+++ lib/lp/blueprints/stories/sprints/20-sprint-registration.txt 2010-10-21 19:08:55 +0000
@@ -157,9 +157,9 @@
157First, we add a couple of IRC nicknames for Carlos.157First, we add a couple of IRC nicknames for Carlos.
158158
159 >>> from canonical.launchpad.ftests import login, logout159 >>> from canonical.launchpad.ftests import login, logout
160 >>> from zope.component import getUtility
160 >>> from lp.registry.interfaces.person import IPersonSet161 >>> from lp.registry.interfaces.person import IPersonSet
161 >>> from lp.registry.model.person import IrcID162 >>> from lp.registry.model.person import IrcID
162 >>> from zope.component import getUtility
163 >>> login('carlos@canonical.com')163 >>> login('carlos@canonical.com')
164 >>> carlos = getUtility(IPersonSet).getByName('carlos')164 >>> carlos = getUtility(IPersonSet).getByName('carlos')
165 >>> IrcID(person=carlos, network='freenode', nickname='carlos')165 >>> IrcID(person=carlos, network='freenode', nickname='carlos')
166166
=== modified file 'lib/lp/bugs/browser/tests/bug-nomination-views.txt'
--- lib/lp/bugs/browser/tests/bug-nomination-views.txt 2010-10-11 16:17:45 +0000
+++ lib/lp/bugs/browser/tests/bug-nomination-views.txt 2010-10-21 19:08:55 +0000
@@ -7,9 +7,9 @@
77
8 >>> from zope.component import getUtility, getMultiAdapter8 >>> from zope.component import getUtility, getMultiAdapter
99
10 >>> from lp.bugs.interfaces.bugtask import IBugTaskSet
11 >>> from canonical.launchpad.webapp.interfaces import IOpenLaunchBag10 >>> from canonical.launchpad.webapp.interfaces import IOpenLaunchBag
12 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest11 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
12 >>> from lp.bugs.interfaces.bugtask import IBugTaskSet
1313
14 >>> login("no-priv@canonical.com")14 >>> login("no-priv@canonical.com")
1515
1616
=== modified file 'lib/lp/bugs/browser/tests/bug-views.txt'
--- lib/lp/bugs/browser/tests/bug-views.txt 2010-10-14 18:42:19 +0000
+++ lib/lp/bugs/browser/tests/bug-views.txt 2010-10-21 19:08:55 +0000
@@ -27,10 +27,19 @@
27comment, of the bug report.27comment, of the bug report.
2828
29 >>> from zope.component import getMultiAdapter, getUtility29 >>> from zope.component import getMultiAdapter, getUtility
30 >>> from canonical.launchpad.interfaces import (30 >>> from canonical.launchpad.webapp.interfaces import (
31 ... BugTaskSearchParams, IDistributionSet, IBugSet, IBugTaskSet,31 ... ILaunchBag,
32 ... ILaunchBag, IOpenLaunchBag, IPersonSet, IProductSet)32 ... IOpenLaunchBag,
33 ... )
33 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest34 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
35 >>> from lp.bugs.interfaces.bug import IBugSet
36 >>> from lp.bugs.interfaces.bugtask import (
37 ... BugTaskSearchParams,
38 ... IBugTaskSet,
39 ... )
40 >>> from lp.registry.interfaces.distribution import IDistributionSet
41 >>> from lp.registry.interfaces.person import IPersonSet
42 >>> from lp.registry.interfaces.product import IProductSet
3443
35 >>> launchbag = getUtility(IOpenLaunchBag)44 >>> launchbag = getUtility(IOpenLaunchBag)
36 >>> login("foo.bar@canonical.com")45 >>> login("foo.bar@canonical.com")
@@ -444,8 +453,8 @@
444returned results, because an approved nomination will have created a453returned results, because an approved nomination will have created a
445task anyway.454task anyway.
446455
456 >>> from lp.bugs.interfaces.bugnomination import IBugNomination
447 >>> from lp.bugs.interfaces.bugtask import IBugTask457 >>> from lp.bugs.interfaces.bugtask import IBugTask
448 >>> from lp.bugs.interfaces.bugnomination import IBugNomination
449458
450 >>> def get_object_type(task_or_nomination):459 >>> def get_object_type(task_or_nomination):
451 ... if IBugTask.providedBy(task_or_nomination):460 ... if IBugTask.providedBy(task_or_nomination):
452461
=== modified file 'lib/lp/bugs/browser/tests/buglinktarget-views.txt'
--- lib/lp/bugs/browser/tests/buglinktarget-views.txt 2010-10-03 15:30:06 +0000
+++ lib/lp/bugs/browser/tests/buglinktarget-views.txt 2010-10-21 19:08:55 +0000
@@ -4,9 +4,10 @@
44
5 >>> from zope.component import getMultiAdapter5 >>> from zope.component import getMultiAdapter
6 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest6 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
7 >>> from canonical.launchpad.interfaces import (
8 ... IBugLinkTarget, IBugSet, ICveSet)
9 >>> from lazr.lifecycle.event import ObjectModifiedEvent7 >>> from lazr.lifecycle.event import ObjectModifiedEvent
8 >>> from lp.bugs.interfaces.bug import IBugSet
9 >>> from lp.bugs.interfaces.buglink import IBugLinkTarget
10 >>> from lp.bugs.interfaces.cve import ICveSet
1011
11 >>> bugset = getUtility(IBugSet)12 >>> bugset = getUtility(IBugSet)
12 >>> cve = getUtility(ICveSet)['2005-2730']13 >>> cve = getUtility(ICveSet)['2005-2730']
1314
=== modified file 'lib/lp/bugs/browser/tests/bugs-views.txt'
--- lib/lp/bugs/browser/tests/bugs-views.txt 2010-10-11 16:17:45 +0000
+++ lib/lp/bugs/browser/tests/bugs-views.txt 2010-10-21 19:08:55 +0000
@@ -4,9 +4,9 @@
4doesn't use its context for anything, so we don't have to supply one4doesn't use its context for anything, so we don't have to supply one
5when creating it.5when creating it.
66
7 >>> from lp.bugs.browser.bug import MaloneView
8 >>> from canonical.launchpad.systemhomes import MaloneApplication7 >>> from canonical.launchpad.systemhomes import MaloneApplication
9 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest8 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
9 >>> from lp.bugs.browser.bug import MaloneView
10 >>> bugs_view = MaloneView(MaloneApplication(), LaunchpadTestRequest())10 >>> bugs_view = MaloneView(MaloneApplication(), LaunchpadTestRequest())
11 >>> bugs_view.initialize()11 >>> bugs_view.initialize()
1212
@@ -31,8 +31,8 @@
31in the future.31in the future.
3232
33 >>> login('test@canonical.com')33 >>> login('test@canonical.com')
34 >>> from canonical.launchpad.ftests import syncUpdate
34 >>> from lp.bugs.interfaces.bug import IBugSet35 >>> from lp.bugs.interfaces.bug import IBugSet
35 >>> from canonical.launchpad.ftests import syncUpdate
36 >>> bug_eight = getUtility(IBugSet).get(8)36 >>> bug_eight = getUtility(IBugSet).get(8)
37 >>> len(bug_eight.bugtasks)37 >>> len(bug_eight.bugtasks)
38 138 1
3939
=== modified file 'lib/lp/bugs/browser/tests/bugtask-adding-views.txt'
--- lib/lp/bugs/browser/tests/bugtask-adding-views.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/browser/tests/bugtask-adding-views.txt 2010-10-21 19:08:55 +0000
@@ -97,8 +97,8 @@
97most likely to get added. Let's take a look how it works for packages,97most likely to get added. Let's take a look how it works for packages,
98which can have packaging links that helps us choose the product.98which can have packaging links that helps us choose the product.
9999
100 >>> from canonical.launchpad.interfaces import (100 >>> from lp.bugs.interfaces.bug import CreateBugParams
101 ... CreateBugParams, IDistributionSet)101 >>> from lp.registry.interfaces.distribution import IDistributionSet
102 >>> owner = getUtility(ILaunchBag).user102 >>> owner = getUtility(ILaunchBag).user
103 >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu')103 >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
104 >>> ubuntu_firefox = ubuntu.getSourcePackage('mozilla-firefox')104 >>> ubuntu_firefox = ubuntu.getSourcePackage('mozilla-firefox')
@@ -168,8 +168,8 @@
168event listener and register it:168event listener and register it:
169169
170 >>> from zope.interface import Interface170 >>> from zope.interface import Interface
171 >>> from canonical.launchpad.ftests.event import TestEventListener
171 >>> from lazr.lifecycle.interfaces import IObjectCreatedEvent172 >>> from lazr.lifecycle.interfaces import IObjectCreatedEvent
172 >>> from canonical.launchpad.ftests.event import TestEventListener
173173
174 >>> def on_created_event(object, event):174 >>> def on_created_event(object, event):
175 ... print "ObjectCreatedEvent: %r" % object175 ... print "ObjectCreatedEvent: %r" % object
176176
=== modified file 'lib/lp/bugs/browser/tests/bugtask-edit-views.txt'
--- lib/lp/bugs/browser/tests/bugtask-edit-views.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/browser/tests/bugtask-edit-views.txt 2010-10-21 19:08:55 +0000
@@ -10,8 +10,8 @@
10Person:10Person:
1111
12 >>> from zope.component import getMultiAdapter12 >>> from zope.component import getMultiAdapter
13 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
13 >>> from lp.bugs.interfaces.bug import IBugSet14 >>> from lp.bugs.interfaces.bug import IBugSet
14 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
15 >>> login('test@canonical.com')15 >>> login('test@canonical.com')
16 >>> bug_nine = getUtility(IBugSet).get(9)16 >>> bug_nine = getUtility(IBugSet).get(9)
17 >>> ubuntu_thunderbird_task = bug_nine.bugtasks[1]17 >>> ubuntu_thunderbird_task = bug_nine.bugtasks[1]
@@ -83,8 +83,8 @@
83distribution task already has, an error message will occur. First,83distribution task already has, an error message will occur. First,
84let's add an evolution (Ubuntu) task to bug two.84let's add an evolution (Ubuntu) task to bug two.
8585
86 >>> from canonical.launchpad.interfaces import (86 >>> from lp.bugs.interfaces.bugtask import IBugTaskSet
87 ... IBugTaskSet, IDistributionSet)87 >>> from lp.registry.interfaces.distribution import IDistributionSet
88 >>> bug_two = getUtility(IBugSet).get(2)88 >>> bug_two = getUtility(IBugSet).get(2)
89 >>> ubuntu = getUtility(IDistributionSet).getByName("ubuntu")89 >>> ubuntu = getUtility(IDistributionSet).getByName("ubuntu")
90 >>> ubuntu_evolution = ubuntu.getSourcePackage('evolution')90 >>> ubuntu_evolution = ubuntu.getSourcePackage('evolution')
9191
=== modified file 'lib/lp/bugs/browser/tests/bugtask-search-views.txt'
--- lib/lp/bugs/browser/tests/bugtask-search-views.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/browser/tests/bugtask-search-views.txt 2010-10-21 19:08:55 +0000
@@ -3,8 +3,8 @@
3In the 'Bugs' facet of a distribution we can find a list of bugs3In the 'Bugs' facet of a distribution we can find a list of bugs
4reported in that distribution and simple and advanced search forms.4reported in that distribution and simple and advanced search forms.
55
6 >>> from canonical.launchpad.interfaces import (6 >>> from canonical.launchpad.webapp.interfaces import IOpenLaunchBag
7 ... IOpenLaunchBag, IDistributionSet)7 >>> from lp.registry.interfaces.distribution import IDistributionSet
8 >>> launchbag = getUtility(IOpenLaunchBag)8 >>> launchbag = getUtility(IOpenLaunchBag)
9 >>> debian = getUtility(IDistributionSet).getByName('debian')9 >>> debian = getUtility(IDistributionSet).getByName('debian')
1010
@@ -230,8 +230,8 @@
230And now we'll change the status of one of the bugtasks, but first we230And now we'll change the status of one of the bugtasks, but first we
231need to be logged in.231need to be logged in.
232232
233 >>> from canonical.database.sqlbase import flush_database_updates
233 >>> from canonical.launchpad.ftests import login234 >>> from canonical.launchpad.ftests import login
234 >>> from canonical.database.sqlbase import flush_database_updates
235235
236 >>> login("test@canonical.com")236 >>> login("test@canonical.com")
237237
238238
=== modified file 'lib/lp/bugs/browser/tests/distrosourcepackage-bug-views.txt'
--- lib/lp/bugs/browser/tests/distrosourcepackage-bug-views.txt 2010-10-03 15:30:06 +0000
+++ lib/lp/bugs/browser/tests/distrosourcepackage-bug-views.txt 2010-10-21 19:08:55 +0000
@@ -5,9 +5,9 @@
5Simple searching is possible on the distro source package bug view page.5Simple searching is possible on the distro source package bug view page.
66
7 >>> from zope.component import getMultiAdapter, getUtility7 >>> from zope.component import getMultiAdapter, getUtility
8 >>> from canonical.launchpad.interfaces import (
9 ... IDistributionSet, ISourcePackageNameSet)
10 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest8 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
9 >>> from lp.registry.interfaces.distribution import IDistributionSet
10 >>> from lp.registry.interfaces.sourcepackagename import ISourcePackageNameSet
1111
12 >>> debian = getUtility(IDistributionSet).get(3)12 >>> debian = getUtility(IDistributionSet).get(3)
13 >>> mozilla_firefox = getUtility(ISourcePackageNameSet).get(1)13 >>> mozilla_firefox = getUtility(ISourcePackageNameSet).get(1)
1414
=== modified file 'lib/lp/bugs/browser/tests/person-bug-views.txt'
--- lib/lp/bugs/browser/tests/person-bug-views.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/browser/tests/person-bug-views.txt 2010-10-21 19:08:55 +0000
@@ -87,8 +87,8 @@
87Using the advanced form we can also query for closed bugs reported by someone.87Using the advanced form we can also query for closed bugs reported by someone.
88Let's first close a bug setting its status to 'Invalid'.88Let's first close a bug setting its status to 'Invalid'.
8989
90 >>> from canonical.database.sqlbase import flush_database_updates
90 >>> from canonical.launchpad.ftests import login91 >>> from canonical.launchpad.ftests import login
91 >>> from canonical.database.sqlbase import flush_database_updates
9292
93 >>> login("foo.bar@canonical.com")93 >>> login("foo.bar@canonical.com")
9494
9595
=== modified file 'lib/lp/bugs/doc/bug-change.txt'
--- lib/lp/bugs/doc/bug-change.txt 2010-10-03 15:30:06 +0000
+++ lib/lp/bugs/doc/bug-change.txt 2010-10-21 19:08:55 +0000
@@ -3,10 +3,10 @@
3The base class for BugChanges doesn't actually implement anything.3The base class for BugChanges doesn't actually implement anything.
44
5 >>> import pytz5 >>> import pytz
6 >>> from canonical.launchpad.webapp.testing import verifyObject
6 >>> from datetime import datetime7 >>> from datetime import datetime
7 >>> from lp.bugs.adapters.bugchange import BugChangeBase8 >>> from lp.bugs.adapters.bugchange import BugChangeBase
8 >>> from lp.bugs.interfaces.bugchange import IBugChange9 >>> from lp.bugs.interfaces.bugchange import IBugChange
9 >>> from canonical.launchpad.webapp.testing import verifyObject
1010
11 >>> from lp.testing.factory import LaunchpadObjectFactory11 >>> from lp.testing.factory import LaunchpadObjectFactory
12 >>> factory = LaunchpadObjectFactory()12 >>> factory = LaunchpadObjectFactory()
1313
=== modified file 'lib/lp/bugs/doc/bug-export.txt'
--- lib/lp/bugs/doc/bug-export.txt 2010-10-03 15:30:06 +0000
+++ lib/lp/bugs/doc/bug-export.txt 2010-10-21 19:08:55 +0000
@@ -23,10 +23,11 @@
23 ... import xml.etree.cElementTree as ET23 ... import xml.etree.cElementTree as ET
24 ... except ImportError:24 ... except ImportError:
25 ... import cElementTree as ET25 ... import cElementTree as ET
26 >>> from zope.component import getUtility
26 >>> from cStringIO import StringIO27 >>> from cStringIO import StringIO
27 >>> from zope.component import getUtility28 >>> from lp.bugs.interfaces.bug import IBugSet
28 >>> from canonical.launchpad.interfaces import (29 >>> from lp.registry.interfaces.person import IPersonSet
29 ... IBugSet, IPersonSet, IProductSet)30 >>> from lp.registry.interfaces.product import IProductSet
30 >>> from lp.bugs.scripts.bugexport import (31 >>> from lp.bugs.scripts.bugexport import (
31 ... serialise_bugtask, export_bugtasks)32 ... serialise_bugtask, export_bugtasks)
3233
3334
=== modified file 'lib/lp/bugs/doc/bug-nomination.txt'
--- lib/lp/bugs/doc/bug-nomination.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/doc/bug-nomination.txt 2010-10-21 19:08:55 +0000
@@ -6,9 +6,9 @@
66
7 >>> from zope.component import getUtility7 >>> from zope.component import getUtility
8 >>> from zope.interface.verify import verifyClass8 >>> from zope.interface.verify import verifyClass
9 >>> from lp.bugs.model.bugnomination import BugNomination
10 >>> from lp.bugs.interfaces.bug import IBugSet9 >>> from lp.bugs.interfaces.bug import IBugSet
11 >>> from lp.bugs.interfaces.bugnomination import IBugNomination10 >>> from lp.bugs.interfaces.bugnomination import IBugNomination
11 >>> from lp.bugs.model.bugnomination import BugNomination
12 >>> from lp.registry.interfaces.distribution import IDistributionSet12 >>> from lp.registry.interfaces.distribution import IDistributionSet
13 >>> from lp.registry.interfaces.person import IPersonSet13 >>> from lp.registry.interfaces.person import IPersonSet
1414
1515
=== modified file 'lib/lp/bugs/doc/bug-private-by-default.txt'
--- lib/lp/bugs/doc/bug-private-by-default.txt 2010-10-04 19:50:45 +0000
+++ lib/lp/bugs/doc/bug-private-by-default.txt 2010-10-21 19:08:55 +0000
@@ -4,8 +4,9 @@
4(this is enforced by a DB constraint).4(this is enforced by a DB constraint).
55
6 >>> from canonical.testing.layers import LaunchpadZopelessLayer6 >>> from canonical.testing.layers import LaunchpadZopelessLayer
7 >>> from canonical.launchpad.interfaces import (7 >>> from lp.bugs.interfaces.bug import CreateBugParams
8 ... IPersonSet, CreateBugParams, IProductSet)8 >>> from lp.registry.interfaces.person import IPersonSet
9 >>> from lp.registry.interfaces.product import IProductSet
9 >>> LaunchpadZopelessLayer.switchDbUser('launchpad')10 >>> LaunchpadZopelessLayer.switchDbUser('launchpad')
10 >>> no_priv = getUtility(IPersonSet).getByName('no-priv')11 >>> no_priv = getUtility(IPersonSet).getByName('no-priv')
11 >>> name16 = getUtility(IPersonSet).get(16)12 >>> name16 = getUtility(IPersonSet).get(16)
1213
=== modified file 'lib/lp/bugs/doc/bug-reported-acknowledgement.txt'
--- lib/lp/bugs/doc/bug-reported-acknowledgement.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/doc/bug-reported-acknowledgement.txt 2010-10-21 19:08:55 +0000
@@ -7,8 +7,9 @@
77
8 >>> login('foo.bar@canonical.com')8 >>> login('foo.bar@canonical.com')
99
10 >>> from canonical.launchpad.interfaces import (10 >>> from lp.registry.interfaces.distribution import IDistributionSet
11 ... IDistributionSet, IProjectGroupSet, IProductSet)11 >>> from lp.registry.interfaces.product import IProductSet
12 >>> from lp.registry.interfaces.projectgroup import IProjectGroupSet
1213
13 >>> distribution = getUtility(IDistributionSet).getByName('ubuntu')14 >>> distribution = getUtility(IDistributionSet).getByName('ubuntu')
14 >>> distribution_source_package = (15 >>> distribution_source_package = (
1516
=== modified file 'lib/lp/bugs/doc/bug-reporting-guidelines.txt'
--- lib/lp/bugs/doc/bug-reporting-guidelines.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/doc/bug-reporting-guidelines.txt 2010-10-21 19:08:55 +0000
@@ -6,8 +6,9 @@
66
7 >>> login('foo.bar@canonical.com')7 >>> login('foo.bar@canonical.com')
88
9 >>> from canonical.launchpad.interfaces import (9 >>> from lp.registry.interfaces.distribution import IDistributionSet
10 ... IDistributionSet, IProjectGroupSet, IProductSet)10 >>> from lp.registry.interfaces.product import IProductSet
11 >>> from lp.registry.interfaces.projectgroup import IProjectGroupSet
1112
12 >>> distribution = getUtility(IDistributionSet).getByName('ubuntu')13 >>> distribution = getUtility(IDistributionSet).getByName('ubuntu')
13 >>> distribution_source_package = (14 >>> distribution_source_package = (
1415
=== modified file 'lib/lp/bugs/doc/bug-set-status.txt'
--- lib/lp/bugs/doc/bug-set-status.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/doc/bug-set-status.txt 2010-10-21 19:08:55 +0000
@@ -10,9 +10,9 @@
10 >>> login('no-priv@canonical.com')10 >>> login('no-priv@canonical.com')
11 >>> no_priv = getUtility(IPersonSet).getByName('no-priv')11 >>> no_priv = getUtility(IPersonSet).getByName('no-priv')
1212
13 >>> from canonical.launchpad.interfaces import (13 >>> from lp.bugs.interfaces.bug import CreateBugParams
14 ... CreateBugParams, IProductSet)
15 >>> from lp.bugs.interfaces.bugtask import BugTaskStatus14 >>> from lp.bugs.interfaces.bugtask import BugTaskStatus
15 >>> from lp.registry.interfaces.product import IProductSet
16 >>> bug_params = CreateBugParams(16 >>> bug_params = CreateBugParams(
17 ... owner=no_priv, title='Sample bug', comment='This is a sample bug.')17 ... owner=no_priv, title='Sample bug', comment='This is a sample bug.')
18 >>> firefox = getUtility(IProductSet).getByName('firefox')18 >>> firefox = getUtility(IProductSet).getByName('firefox')
1919
=== modified file 'lib/lp/bugs/doc/bug-tags.txt'
--- lib/lp/bugs/doc/bug-tags.txt 2010-10-11 16:17:45 +0000
+++ lib/lp/bugs/doc/bug-tags.txt 2010-10-21 19:08:55 +0000
@@ -67,9 +67,9 @@
67To make it easy editing the tags as a space separated text string, we67To make it easy editing the tags as a space separated text string, we
68use BugTagsWidget.68use BugTagsWidget.
6969
70 >>> from lp.bugs.interfaces.bug import IBug
71 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest70 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
72 >>> from canonical.widgets.bug import BugTagsWidget71 >>> from canonical.widgets.bug import BugTagsWidget
72 >>> from lp.bugs.interfaces.bug import IBug
73 >>> bug_tags_field = IBug['tags'].bind(bug_one)73 >>> bug_tags_field = IBug['tags'].bind(bug_one)
74 >>> tag_field = bug_tags_field.value_type74 >>> tag_field = bug_tags_field.value_type
75 >>> request = LaunchpadTestRequest()75 >>> request = LaunchpadTestRequest()
@@ -178,9 +178,9 @@
178178
179We can search for bugs with some specific tag.179We can search for bugs with some specific tag.
180180
181 >>> from canonical.launchpad.interfaces import (
182 ... BugTaskSearchParams, IDistributionSet)
183 >>> from canonical.launchpad.searchbuilder import all181 >>> from canonical.launchpad.searchbuilder import all
182 >>> from lp.bugs.interfaces.bugtask import BugTaskSearchParams
183 >>> from lp.registry.interfaces.distribution import IDistributionSet
184 >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu')184 >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
185 >>> svg_tasks = ubuntu.searchTasks(185 >>> svg_tasks = ubuntu.searchTasks(
186 ... BugTaskSearchParams(tag=all(u'svg'), user=None))186 ... BugTaskSearchParams(tag=all(u'svg'), user=None))
187187
=== modified file 'lib/lp/bugs/doc/bug.txt'
--- lib/lp/bugs/doc/bug.txt 2010-08-30 05:19:46 +0000
+++ lib/lp/bugs/doc/bug.txt 2010-10-21 19:08:55 +0000
@@ -313,8 +313,8 @@
313Note that a search will return all public bugs, omitting bug 14 which is313Note that a search will return all public bugs, omitting bug 14 which is
314private:314private:
315315
316 >>> from canonical.launchpad.interfaces.lpstorm import IStore
316 >>> from lp.bugs.model.bug import Bug317 >>> from lp.bugs.model.bug import Bug
317 >>> from canonical.launchpad.interfaces.lpstorm import IStore
318 >>> all_bugs = set(IStore(Bug).find(Bug).values(Bug.id))318 >>> all_bugs = set(IStore(Bug).find(Bug).values(Bug.id))
319319
320 >>> def hidden_bugs():320 >>> def hidden_bugs():
321321
=== modified file 'lib/lp/bugs/doc/bugactivity.txt'
--- lib/lp/bugs/doc/bugactivity.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/doc/bugactivity.txt 2010-10-21 19:08:55 +0000
@@ -22,9 +22,13 @@
22 >>> from zope.event import notify22 >>> from zope.event import notify
23 >>> from lazr.lifecycle.event import (23 >>> from lazr.lifecycle.event import (
24 ... ObjectCreatedEvent, ObjectModifiedEvent)24 ... ObjectCreatedEvent, ObjectModifiedEvent)
25 >>> from canonical.launchpad.interfaces import (
26 ... IUpstreamBugTask, IDistroBugTask, IProductSet, IBugTaskSet)
27 >>> from lazr.lifecycle.snapshot import Snapshot25 >>> from lazr.lifecycle.snapshot import Snapshot
26 >>> from lp.bugs.interfaces.bugtask import (
27 ... IBugTaskSet,
28 ... IDistroBugTask,
29 ... IUpstreamBugTask,
30 ... )
31 >>> from lp.registry.interfaces.product import IProductSet
28 >>> user = getUtility(ILaunchBag).user32 >>> user = getUtility(ILaunchBag).user
2933
3034
@@ -67,8 +71,8 @@
6771
68 >>> from lazr.lifecycle.snapshot import Snapshot72 >>> from lazr.lifecycle.snapshot import Snapshot
69 >>> from lp.bugs.interfaces.bugtask import BugTaskStatus73 >>> from lp.bugs.interfaces.bugtask import BugTaskStatus
70 >>> from canonical.launchpad.interfaces import (74 >>> from lp.registry.interfaces.distribution import IDistributionSet
71 ... ISourcePackageNameSet, IDistributionSet)75 >>> from lp.registry.interfaces.sourcepackagename import ISourcePackageNameSet
72 >>> mozilla_firefox = getUtility(ISourcePackageNameSet)['mozilla-firefox']76 >>> mozilla_firefox = getUtility(ISourcePackageNameSet)['mozilla-firefox']
73 >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu')77 >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
74 >>> source_package_assignment = getUtility(IBugTaskSet).createTask(78 >>> source_package_assignment = getUtility(IBugTaskSet).createTask(
7579
=== modified file 'lib/lp/bugs/doc/bugattachments.txt'
--- lib/lp/bugs/doc/bugattachments.txt 2010-10-03 15:30:06 +0000
+++ lib/lp/bugs/doc/bugattachments.txt 2010-10-21 19:08:55 +0000
@@ -10,8 +10,10 @@
10 >>> from canonical.launchpad.ftests import login10 >>> from canonical.launchpad.ftests import login
11 >>> login("foo.bar@canonical.com")11 >>> login("foo.bar@canonical.com")
1212
13 >>> from canonical.launchpad.interfaces import (13 >>> from canonical.launchpad.interfaces.message import IMessageSet
14 ... IBugAttachment, IBugSet, IMessageSet, IPersonSet)14 >>> from lp.bugs.interfaces.bug import IBugSet
15 >>> from lp.bugs.interfaces.bugattachment import IBugAttachment
16 >>> from lp.registry.interfaces.person import IPersonSet
15 >>> bugset = getUtility(IBugSet)17 >>> bugset = getUtility(IBugSet)
16 >>> bug_one = bugset.get(1)18 >>> bug_one = bugset.get(1)
17 >>> bug_one.attachments.count()19 >>> bug_one.attachments.count()
@@ -382,8 +384,11 @@
382384
383We can search for attachment of a specific types:385We can search for attachment of a specific types:
384386
385 >>> from canonical.launchpad.interfaces import (387 >>> from lp.bugs.interfaces.bugattachment import BugAttachmentType
386 ... BugAttachmentType, BugTaskSearchParams, IBugTaskSet)388 >>> from lp.bugs.interfaces.bugtask import (
389 ... BugTaskSearchParams,
390 ... IBugTaskSet,
391 ... )
387 >>> bugtaskset = getUtility(IBugTaskSet)392 >>> bugtaskset = getUtility(IBugTaskSet)
388 >>> attachmenttype = BugAttachmentType.UNSPECIFIED393 >>> attachmenttype = BugAttachmentType.UNSPECIFIED
389 >>> params = BugTaskSearchParams(attachmenttype=attachmenttype, user=None)394 >>> params = BugTaskSearchParams(attachmenttype=attachmenttype, user=None)
390395
=== modified file 'lib/lp/bugs/doc/bugcomment.txt'
--- lib/lp/bugs/doc/bugcomment.txt 2010-10-14 18:42:19 +0000
+++ lib/lp/bugs/doc/bugcomment.txt 2010-10-21 19:08:55 +0000
@@ -5,8 +5,8 @@
5independently.5independently.
66
7 >>> from zope.component import getMultiAdapter7 >>> from zope.component import getMultiAdapter
8 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
8 >>> from lp.bugs.interfaces.bug import IBugSet9 >>> from lp.bugs.interfaces.bug import IBugSet
9 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
1010
1111
12== Handling of the bug's first comment ==12== Handling of the bug's first comment ==
1313
=== modified file 'lib/lp/bugs/doc/bugmessage-visibility.txt'
--- lib/lp/bugs/doc/bugmessage-visibility.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/doc/bugmessage-visibility.txt 2010-10-21 19:08:55 +0000
@@ -6,8 +6,8 @@
6A bug message has a visible field, which is True by default.6A bug message has a visible field, which is True by default.
77
8 # Setup for creating a new message8 # Setup for creating a new message
9 >>> from lp.bugs.interfaces.bug import IBugSet
9 >>> from lp.bugs.interfaces.bugmessage import IBugMessageSet10 >>> from lp.bugs.interfaces.bugmessage import IBugMessageSet
10 >>> from lp.bugs.interfaces.bug import IBugSet
11 >>> from lp.registry.interfaces.person import IPersonSet11 >>> from lp.registry.interfaces.person import IPersonSet
1212
13 >>> bugmessageset = getUtility(IBugMessageSet)13 >>> bugmessageset = getUtility(IBugMessageSet)
1414
=== modified file 'lib/lp/bugs/doc/bugnotification-email.txt'
--- lib/lp/bugs/doc/bugnotification-email.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/doc/bugnotification-email.txt 2010-10-21 19:08:55 +0000
@@ -28,9 +28,13 @@
28examples that follow:28examples that follow:
2929
30 >>> from zope.component import getUtility30 >>> from zope.component import getUtility
31 >>> from canonical.launchpad.interfaces import (31 >>> from canonical.launchpad.interfaces.emailaddress import IEmailAddressSet
32 ... IBugDelta, IBugSet, IEmailAddressSet, IPersonSet)
33 >>> from lp.bugs.adapters.bugdelta import BugDelta32 >>> from lp.bugs.adapters.bugdelta import BugDelta
33 >>> from lp.bugs.interfaces.bug import (
34 ... IBugDelta,
35 ... IBugSet,
36 ... )
37 >>> from lp.registry.interfaces.person import IPersonSet
3438
35= Filing a bug =39= Filing a bug =
3640
@@ -280,10 +284,13 @@
280284
281We use a BugTaskDelta to represent changes to a BugTask.285We use a BugTaskDelta to represent changes to a BugTask.
282286
283 >>> from canonical.launchpad.interfaces import (287 >>> from canonical.launchpad.webapp.testing import verifyObject
284 ... BugTaskStatus, IBugTaskDelta, IBugTaskSet)288 >>> from lp.bugs.interfaces.bugtask import (
289 ... BugTaskStatus,
290 ... IBugTaskDelta,
291 ... IBugTaskSet,
292 ... )
285 >>> from lp.bugs.model.bugtask import BugTaskDelta293 >>> from lp.bugs.model.bugtask import BugTaskDelta
286 >>> from canonical.launchpad.webapp.testing import verifyObject
287 >>> example_bug_task = factory.makeBugTask()294 >>> example_bug_task = factory.makeBugTask()
288 >>> example_delta = BugTaskDelta(example_bug_task)295 >>> example_delta = BugTaskDelta(example_bug_task)
289 >>> verifyObject(IBugTaskDelta, example_delta)296 >>> verifyObject(IBugTaskDelta, example_delta)
290297
=== modified file 'lib/lp/bugs/doc/bugnotification-sending.txt'
--- lib/lp/bugs/doc/bugnotification-sending.txt 2010-10-11 16:17:45 +0000
+++ lib/lp/bugs/doc/bugnotification-sending.txt 2010-10-21 19:08:55 +0000
@@ -54,8 +54,8 @@
54Anyway, let's start our demonstration by adding a comment to a bug:54Anyway, let's start our demonstration by adding a comment to a bug:
5555
56 >>> login('test@canonical.com')56 >>> login('test@canonical.com')
57 >>> from canonical.launchpad.interfaces.message import IMessageSet
57 >>> from lp.bugs.interfaces.bug import IBugSet58 >>> from lp.bugs.interfaces.bug import IBugSet
58 >>> from canonical.launchpad.interfaces.message import IMessageSet
59 >>> bug_one = getUtility(IBugSet).get(1)59 >>> bug_one = getUtility(IBugSet).get(1)
60 >>> sample_person = getUtility(ILaunchBag).user60 >>> sample_person = getUtility(ILaunchBag).user
61 >>> comment = getUtility(IMessageSet).fromText(61 >>> comment = getUtility(IMessageSet).fromText(
@@ -374,8 +374,8 @@
374374
375We will also need a fresh new bug.375We will also need a fresh new bug.
376376
377 >>> from canonical.launchpad.interfaces import (377 >>> from lp.bugs.interfaces.bug import CreateBugParams
378 ... IDistributionSet, CreateBugParams)378 >>> from lp.registry.interfaces.distribution import IDistributionSet
379 >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu')379 >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
380 >>> description = getUtility(IMessageSet).fromText(380 >>> description = getUtility(IMessageSet).fromText(
381 ... 'subject', 'a description of the bug.', sample_person,381 ... 'subject', 'a description of the bug.', sample_person,
382382
=== modified file 'lib/lp/bugs/doc/bugnotification-threading.txt'
--- lib/lp/bugs/doc/bugnotification-threading.txt 2010-10-11 16:17:45 +0000
+++ lib/lp/bugs/doc/bugnotification-threading.txt 2010-10-21 19:08:55 +0000
@@ -9,8 +9,8 @@
99
10Let's add add change notification and see how it works:10Let's add add change notification and see how it works:
1111
12 >>> from canonical.database.sqlbase import flush_database_updates
12 >>> from canonical.launchpad.database import MessageSet13 >>> from canonical.launchpad.database import MessageSet
13 >>> from canonical.database.sqlbase import flush_database_updates
1414
15 >>> login('test@canonical.com')15 >>> login('test@canonical.com')
1616
1717
=== modified file 'lib/lp/bugs/doc/bugnotificationrecipients.txt'
--- lib/lp/bugs/doc/bugnotificationrecipients.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/doc/bugnotificationrecipients.txt 2010-10-21 19:08:55 +0000
@@ -11,16 +11,16 @@
11action:11action:
1212
13 >>> from lp.bugs.model.bug import Bug13 >>> from lp.bugs.model.bug import Bug
14 >>> from lp.registry.model.distribution import Distribution
14 >>> from lp.registry.model.product import Product15 >>> from lp.registry.model.product import Product
15 >>> from lp.registry.model.distribution import Distribution
16 >>> bug_one = Bug.get(1)16 >>> bug_one = Bug.get(1)
17 >>> recipients = bug_one.getBugNotificationRecipients()17 >>> recipients = bug_one.getBugNotificationRecipients()
1818
19The instance of BugNotificationRecipients we get back correctly19The instance of BugNotificationRecipients we get back correctly
20implements INotificationRecipientSet:20implements INotificationRecipientSet:
2121
22 >>> from canonical.launchpad.interfaces.launchpad import INotificationRecipientSet
22 >>> from canonical.launchpad.webapp.testing import verifyObject23 >>> from canonical.launchpad.webapp.testing import verifyObject
23 >>> from canonical.launchpad.interfaces.launchpad import INotificationRecipientSet
24 >>> verifyObject(INotificationRecipientSet, recipients)24 >>> verifyObject(INotificationRecipientSet, recipients)
25 True25 True
2626
2727
=== modified file 'lib/lp/bugs/doc/bugnotifications.txt'
--- lib/lp/bugs/doc/bugnotifications.txt 2010-10-10 15:39:28 +0000
+++ lib/lp/bugs/doc/bugnotifications.txt 2010-10-21 19:08:55 +0000
@@ -26,9 +26,12 @@
26 >>> from zope.event import notify26 >>> from zope.event import notify
27 >>> from lazr.lifecycle.event import (27 >>> from lazr.lifecycle.event import (
28 ... ObjectModifiedEvent, ObjectCreatedEvent)28 ... ObjectModifiedEvent, ObjectCreatedEvent)
29 >>> from canonical.launchpad.interfaces import (29 >>> from lp.bugs.interfaces.bug import CreateBugParams
30 ... CreateBugParams, IDistributionSet, IDistroSeriesSet, IPersonSet,30 >>> from lp.registry.interfaces.distribution import IDistributionSet
31 ... IProductSet, ISourcePackageNameSet)31 >>> from lp.registry.interfaces.distroseries import IDistroSeriesSet
32 >>> from lp.registry.interfaces.person import IPersonSet
33 >>> from lp.registry.interfaces.product import IProductSet
34 >>> from lp.registry.interfaces.sourcepackagename import ISourcePackageNameSet
3235
33 >>> bug_submitter = getUtility(IPersonSet).get(12)36 >>> bug_submitter = getUtility(IPersonSet).get(12)
34 >>> firefox = getUtility(IProductSet).get(4)37 >>> firefox = getUtility(IProductSet).get(4)
@@ -51,8 +54,8 @@
5154
52=== Editing a bug report ===55=== Editing a bug report ===
5356
57 >>> from lazr.lifecycle.snapshot import Snapshot
54 >>> from lp.bugs.interfaces.bug import IBug58 >>> from lp.bugs.interfaces.bug import IBug
55 >>> from lazr.lifecycle.snapshot import Snapshot
56 >>> bug_before_modification = Snapshot(firefox_crashes, providing=IBug)59 >>> bug_before_modification = Snapshot(firefox_crashes, providing=IBug)
57 >>> firefox_crashes.description = "a new description"60 >>> firefox_crashes.description = "a new description"
58 >>> firefox_crashes_modified = ObjectModifiedEvent(61 >>> firefox_crashes_modified = ObjectModifiedEvent(
@@ -207,9 +210,11 @@
207Let's demonstrate a notification email where Sample Person marks a210Let's demonstrate a notification email where Sample Person marks a
208task Fixed, and assigns himself to it.211task Fixed, and assigns himself to it.
209212
210 >>> from canonical.launchpad.interfaces import (
211 ... BugTaskStatus, IDistroBugTask)
212 >>> from lazr.lifecycle.snapshot import Snapshot213 >>> from lazr.lifecycle.snapshot import Snapshot
214 >>> from lp.bugs.interfaces.bugtask import (
215 ... BugTaskStatus,
216 ... IDistroBugTask,
217 ... )
213218
214 >>> bugtask_before_modification = Snapshot(219 >>> bugtask_before_modification = Snapshot(
215 ... firefox_crashes_in_debian, providing=IDistroBugTask)220 ... firefox_crashes_in_debian, providing=IDistroBugTask)
216221
=== modified file 'lib/lp/bugs/doc/bugsubscription.txt'
--- lib/lp/bugs/doc/bugsubscription.txt 2010-10-15 14:26:57 +0000
+++ lib/lp/bugs/doc/bugsubscription.txt 2010-10-21 19:08:55 +0000
@@ -12,8 +12,8 @@
1212
13IBug has a subscriptions attribute:13IBug has a subscriptions attribute:
1414
15 >>> from zope.component import getUtility
15 >>> from lp.bugs.interfaces.bug import IBugSet16 >>> from lp.bugs.interfaces.bug import IBugSet
16 >>> from zope.component import getUtility
17 >>> bugset = getUtility(IBugSet)17 >>> bugset = getUtility(IBugSet)
18 >>> bug = bugset.get(1)18 >>> bug = bugset.get(1)
19 >>> bug.subscriptions.count()19 >>> bug.subscriptions.count()
@@ -43,8 +43,10 @@
43Let's create a new bug to demonstrate how direct and indirect43Let's create a new bug to demonstrate how direct and indirect
44subscriptions work.44subscriptions work.
4545
46 >>> from canonical.launchpad.interfaces import (46 >>> from canonical.launchpad.webapp.interfaces import ILaunchBag
47 ... IDistributionSet, ILaunchBag, IPersonSet, CreateBugParams)47 >>> from lp.bugs.interfaces.bug import CreateBugParams
48 >>> from lp.registry.interfaces.distribution import IDistributionSet
49 >>> from lp.registry.interfaces.person import IPersonSet
48 >>> ubuntu = getUtility(IDistributionSet).getByName("ubuntu")50 >>> ubuntu = getUtility(IDistributionSet).getByName("ubuntu")
49 >>> personset = getUtility(IPersonSet)51 >>> personset = getUtility(IPersonSet)
5052
5153
=== modified file 'lib/lp/bugs/doc/bugtarget.txt'
--- lib/lp/bugs/doc/bugtarget.txt 2010-10-03 15:30:06 +0000
+++ lib/lp/bugs/doc/bugtarget.txt 2010-10-21 19:08:55 +0000
@@ -12,8 +12,9 @@
12target (such as in filterable e-mail messages).12target (such as in filterable e-mail messages).
1313
14 >>> from zope.component import getUtility14 >>> from zope.component import getUtility
15 >>> from canonical.launchpad.interfaces import (15 >>> from lp.bugs.interfaces.bugtarget import IBugTarget
16 ... IBugTarget, IDistributionSet, IProductSet)16 >>> from lp.registry.interfaces.distribution import IDistributionSet
17 >>> from lp.registry.interfaces.product import IProductSet
17 >>> distroset = getUtility(IDistributionSet)18 >>> distroset = getUtility(IDistributionSet)
18 >>> debian = distroset.getByName("debian")19 >>> debian = distroset.getByName("debian")
19 >>> debian_firefox = debian.getSourcePackage("mozilla-firefox")20 >>> debian_firefox = debian.getSourcePackage("mozilla-firefox")
2021
=== modified file 'lib/lp/bugs/doc/bugtask-bugwatch-widget.txt'
--- lib/lp/bugs/doc/bugtask-bugwatch-widget.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/doc/bugtask-bugwatch-widget.txt 2010-10-21 19:08:55 +0000
@@ -19,8 +19,8 @@
1919
20Now we can create a widget using a test request:20Now we can create a widget using a test request:
2121
22 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
22 >>> from canonical.widgets.bugtask import BugTaskBugWatchWidget23 >>> from canonical.widgets.bugtask import BugTaskBugWatchWidget
23 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
24 >>> request = LaunchpadTestRequest()24 >>> request = LaunchpadTestRequest()
25 >>> bugwatch_widget = BugTaskBugWatchWidget(25 >>> bugwatch_widget = BugTaskBugWatchWidget(
26 ... bugwatch_field, bugwatch_field.vocabulary, request)26 ... bugwatch_field, bugwatch_field.vocabulary, request)
2727
=== modified file 'lib/lp/bugs/doc/bugtask-expiration.txt'
--- lib/lp/bugs/doc/bugtask-expiration.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/doc/bugtask-expiration.txt 2010-10-21 19:08:55 +0000
@@ -31,9 +31,11 @@
31(min_days_old) that the bugtask has been in the unattended Incomplete31(min_days_old) that the bugtask has been in the unattended Incomplete
32status. It also requires specifying the user that is doing the search.32status. It also requires specifying the user that is doing the search.
3333
34 >>> from lp.bugs.interfaces.bugtask import (
35 ... BugTaskStatus,
36 ... IBugTaskSet,
37 ... )
34 >>> from storm.store import Store38 >>> from storm.store import Store
35 >>> from canonical.launchpad.interfaces import (
36 ... BugTaskStatus, IBugTaskSet)
37 >>> bugtaskset = getUtility(IBugTaskSet)39 >>> bugtaskset = getUtility(IBugTaskSet)
3840
39 >>> expirable_bugtasks = bugtaskset.findExpirableBugTasks()41 >>> expirable_bugtasks = bugtaskset.findExpirableBugTasks()
@@ -64,8 +66,9 @@
64can_expire avoid an expensive db, in the case where we can easily tell66can_expire avoid an expensive db, in the case where we can easily tell
65that no bug tasks can be expired.67that no bug tasks can be expired.
6668
67 >>> from canonical.launchpad.interfaces import (69 >>> from lp.registry.interfaces.distribution import IDistributionSet
68 ... IDistributionSet, IPersonSet, IProductSet)70 >>> from lp.registry.interfaces.person import IPersonSet
71 >>> from lp.registry.interfaces.product import IProductSet
69 >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu')72 >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
70 >>> jokosher = getUtility(IProductSet).getByName('jokosher')73 >>> jokosher = getUtility(IProductSet).getByName('jokosher')
71 >>> sample_person = getUtility(IPersonSet).getByEmail(74 >>> sample_person = getUtility(IPersonSet).getByEmail(
7275
=== modified file 'lib/lp/bugs/doc/bugtask-find-similar.txt'
--- lib/lp/bugs/doc/bugtask-find-similar.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/doc/bugtask-find-similar.txt 2010-10-21 19:08:55 +0000
@@ -11,8 +11,9 @@
11It doesn't make much sense to find bugs similar to an empty string, so11It doesn't make much sense to find bugs similar to an empty string, so
12no results will be returned.12no results will be returned.
1313
14 >>> from canonical.launchpad.interfaces import (14 >>> from lp.bugs.interfaces.bugtask import IBugTaskSet
15 ... IBugTaskSet, IPersonSet, IProductSet)15 >>> from lp.registry.interfaces.person import IPersonSet
16 >>> from lp.registry.interfaces.product import IProductSet
16 >>> firefox = getUtility(IProductSet).getByName('firefox')17 >>> firefox = getUtility(IProductSet).getByName('firefox')
17 >>> sample_person = getUtility(IPersonSet).getByEmail('test@canonical.com')18 >>> sample_person = getUtility(IPersonSet).getByEmail('test@canonical.com')
18 >>> similar_bugs = getUtility(IBugTaskSet).findSimilar(19 >>> similar_bugs = getUtility(IBugTaskSet).findSimilar(
@@ -80,8 +81,8 @@
80the Firefox bug to private, and repeat the search as a user who isn't81the Firefox bug to private, and repeat the search as a user who isn't
81allowed to view it, only the Thunderbird bug will be returned this time.82allowed to view it, only the Thunderbird bug will be returned this time.
8283
84 >>> from canonical.launchpad.ftests import syncUpdate
83 >>> from lp.bugs.interfaces.bug import IBugSet85 >>> from lp.bugs.interfaces.bug import IBugSet
84 >>> from canonical.launchpad.ftests import syncUpdate
85 >>> login('test@canonical.com')86 >>> login('test@canonical.com')
86 >>> firefox_svg_bug = getUtility(IBugSet).get(1)87 >>> firefox_svg_bug = getUtility(IBugSet).get(1)
87 >>> firefox_svg_bug.setPrivate(True, getUtility(ILaunchBag).user)88 >>> firefox_svg_bug.setPrivate(True, getUtility(ILaunchBag).user)
8889
=== modified file 'lib/lp/bugs/doc/bugtask-package-widget.txt'
--- lib/lp/bugs/doc/bugtask-package-widget.txt 2010-10-10 15:39:28 +0000
+++ lib/lp/bugs/doc/bugtask-package-widget.txt 2010-10-21 19:08:55 +0000
@@ -12,9 +12,9 @@
12to map the package names, we need a distribution, so we give the widget12to map the package names, we need a distribution, so we give the widget
13a distribution task to work with.13a distribution task to work with.
1414
15 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
15 >>> from lp.bugs.interfaces.bug import IBugSet16 >>> from lp.bugs.interfaces.bug import IBugSet
16 >>> from lp.bugs.interfaces.bugtask import IDistroBugTask17 >>> from lp.bugs.interfaces.bugtask import IDistroBugTask
17 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
18 >>> bug_one = getUtility(IBugSet).get(1)18 >>> bug_one = getUtility(IBugSet).get(1)
19 >>> ubuntu_task = bug_one.bugtasks[-2]19 >>> ubuntu_task = bug_one.bugtasks[-2]
20 >>> ubuntu_task.distribution.name20 >>> ubuntu_task.distribution.name
2121
=== modified file 'lib/lp/bugs/doc/bugtask-retrieval.txt'
--- lib/lp/bugs/doc/bugtask-retrieval.txt 2010-10-03 15:30:06 +0000
+++ lib/lp/bugs/doc/bugtask-retrieval.txt 2010-10-21 19:08:55 +0000
@@ -5,9 +5,11 @@
5implementation of IBugTaskSet, allowing retrieval of any bug task in5implementation of IBugTaskSet, allowing retrieval of any bug task in
6Launchpad. We'll use this implementation for demonstration purposes:6Launchpad. We'll use this implementation for demonstration purposes:
77
8 >>> from canonical.launchpad.interfaces import (
9 ... IBugTask, IBugTaskSet)
10 >>> from lp.app.errors import NotFoundError8 >>> from lp.app.errors import NotFoundError
9 >>> from lp.bugs.interfaces.bugtask import (
10 ... IBugTask,
11 ... IBugTaskSet,
12 ... )
11 >>> task_set = getUtility(IBugTaskSet)13 >>> task_set = getUtility(IBugTaskSet)
1214
1315
1416
=== modified file 'lib/lp/bugs/doc/bugtask-search.txt'
--- lib/lp/bugs/doc/bugtask-search.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/doc/bugtask-search.txt 2010-10-21 19:08:55 +0000
@@ -4,8 +4,10 @@
4method, but they all delegate the search to IBugTaskSet.search(). That4method, but they all delegate the search to IBugTaskSet.search(). That
5method accepts a single parameter; an BugTaskSearchParams instance.5method accepts a single parameter; an BugTaskSearchParams instance.
66
7 >>> from canonical.launchpad.interfaces import (7 >>> from lp.bugs.interfaces.bugtask import (
8 ... BugTaskSearchParams, IBugTaskSet)8 ... BugTaskSearchParams,
9 ... IBugTaskSet,
10 ... )
9 >>> bugtask_set = getUtility(IBugTaskSet)11 >>> bugtask_set = getUtility(IBugTaskSet)
10 >>> all_public = BugTaskSearchParams(user=None)12 >>> all_public = BugTaskSearchParams(user=None)
11 >>> found_bugtasks = bugtask_set.search(all_public)13 >>> found_bugtasks = bugtask_set.search(all_public)
@@ -293,8 +295,10 @@
293295
294Add an Ubuntu bugtask for a bug that is confirmed upstream.296Add an Ubuntu bugtask for a bug that is confirmed upstream.
295297
296 >>> from canonical.launchpad.interfaces import (298 >>> from lp.bugs.interfaces.bugtask import (
297 ... BugTaskImportance, BugTaskStatus)299 ... BugTaskImportance,
300 ... BugTaskStatus,
301 ... )
298 >>> from lp.bugs.tests.test_bugtask_1 import (302 >>> from lp.bugs.tests.test_bugtask_1 import (
299 ... BugTaskSearchBugsElsewhereTest)303 ... BugTaskSearchBugsElsewhereTest)
300 >>> def bugTaskInfo(bugtask):304 >>> def bugTaskInfo(bugtask):
@@ -736,9 +740,12 @@
736It's possible to search for bugs with an attachment of a certain type.740It's possible to search for bugs with an attachment of a certain type.
737741
738 >>> from StringIO import StringIO742 >>> from StringIO import StringIO
739 >>> from canonical.launchpad.interfaces import (743 >>> from canonical.launchpad.interfaces.librarian import ILibraryFileAliasSet
740 ... BugAttachmentType, IBugAttachmentSet, ILibraryFileAliasSet,744 >>> from canonical.launchpad.interfaces.message import IMessageSet
741 ... IMessageSet)745 >>> from lp.bugs.interfaces.bugattachment import (
746 ... BugAttachmentType,
747 ... IBugAttachmentSet,
748 ... )
742 >>> product = factory.makeProduct()749 >>> product = factory.makeProduct()
743 >>> patch_bug = factory.makeBug(750 >>> patch_bug = factory.makeBug(
744 ... product=product)751 ... product=product)
745752
=== modified file 'lib/lp/bugs/doc/bugtask-status-workflow.txt'
--- lib/lp/bugs/doc/bugtask-status-workflow.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/doc/bugtask-status-workflow.txt 2010-10-21 19:08:55 +0000
@@ -11,8 +11,9 @@
11a new bug to work with:11a new bug to work with:
1212
13 >>> from zope.component import getUtility13 >>> from zope.component import getUtility
14 >>> from canonical.launchpad.interfaces import (14 >>> from canonical.launchpad.webapp.interfaces import ILaunchBag
15 ... IDistributionSet, ILaunchBag, CreateBugParams)15 >>> from lp.bugs.interfaces.bug import CreateBugParams
16 >>> from lp.registry.interfaces.distribution import IDistributionSet
1617
17 >>> login("foo.bar@canonical.com")18 >>> login("foo.bar@canonical.com")
18 >>> foobar = getUtility(ILaunchBag).user19 >>> foobar = getUtility(ILaunchBag).user
1920
=== modified file 'lib/lp/bugs/doc/bugtask.txt'
--- lib/lp/bugs/doc/bugtask.txt 2010-10-10 15:39:28 +0000
+++ lib/lp/bugs/doc/bugtask.txt 2010-10-21 19:08:55 +0000
@@ -41,8 +41,10 @@
4141
42Next, we need to grab some values to provide for importance and status.42Next, we need to grab some values to provide for importance and status.
4343
44 >>> from canonical.launchpad.interfaces import (44 >>> from lp.bugs.interfaces.bugtask import (
45 ... BugTaskImportance, BugTaskStatus)45 ... BugTaskImportance,
46 ... BugTaskStatus,
47 ... )
46 >>> STATUS_NEW = BugTaskStatus.NEW48 >>> STATUS_NEW = BugTaskStatus.NEW
47 >>> STATUS_CONFIRMED = BugTaskStatus.CONFIRMED49 >>> STATUS_CONFIRMED = BugTaskStatus.CONFIRMED
48 >>> STATUS_FIXRELEASED = BugTaskStatus.FIXRELEASED50 >>> STATUS_FIXRELEASED = BugTaskStatus.FIXRELEASED
@@ -105,8 +107,8 @@
105107
106== Bug Task Targets ==108== Bug Task Targets ==
107109
110 >>> from lp.registry.interfaces.distributionsourcepackage import IDistributionSourcePackage
108 >>> from lp.registry.model.distributionsourcepackage import DistributionSourcePackage111 >>> from lp.registry.model.distributionsourcepackage import DistributionSourcePackage
109 >>> from lp.registry.interfaces.distributionsourcepackage import IDistributionSourcePackage
110112
111The "target" of an IBugTask can be one of the items in the following113The "target" of an IBugTask can be one of the items in the following
112list.114list.
@@ -165,8 +167,8 @@
165167
166 * a distroseries sourcepackage168 * a distroseries sourcepackage
167169
170 >>> from lp.registry.interfaces.sourcepackage import ISourcePackage
168 >>> from lp.registry.model.sourcepackage import SourcePackage171 >>> from lp.registry.model.sourcepackage import SourcePackage
169 >>> from lp.registry.interfaces.sourcepackage import ISourcePackage
170 >>> distro_series_sp_task = bugtaskset.get(16)172 >>> distro_series_sp_task = bugtaskset.get(16)
171 >>> expected_target = SourcePackage(173 >>> expected_target = SourcePackage(
172 ... distroseries=distro_series_sp_task.distroseries,174 ... distroseries=distro_series_sp_task.distroseries,
@@ -825,8 +827,8 @@
825later on the interaction between privacy and teams (see the section827later on the interaction between privacy and teams (see the section
826entitled _Privacy and Team Awareness_):828entitled _Privacy and Team Awareness_):
827829
830 >>> from lazr.lifecycle.snapshot import Snapshot
828 >>> from lp.bugs.interfaces.bug import IBug831 >>> from lp.bugs.interfaces.bug import IBug
829 >>> from lazr.lifecycle.snapshot import Snapshot
830832
831 >>> bug_upstream_firefox_no_svg_support = bugtaskset.get(2)833 >>> bug_upstream_firefox_no_svg_support = bugtaskset.get(2)
832834
833835
=== modified file 'lib/lp/bugs/doc/bugtracker.txt'
--- lib/lp/bugs/doc/bugtracker.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/doc/bugtracker.txt 2010-10-21 19:08:55 +0000
@@ -139,8 +139,8 @@
139bugtracker it will use make_bugtracker_name() to generate a name for the139bugtracker it will use make_bugtracker_name() to generate a name for the
140bug tracker.140bug tracker.
141141
142 >>> from canonical.launchpad.interfaces import (142 >>> from lp.bugs.interfaces.bugtracker import BugTrackerType
143 ... BugTrackerType, IPersonSet)143 >>> from lp.registry.interfaces.person import IPersonSet
144 >>> sample_person = getUtility(IPersonSet).getByEmail(144 >>> sample_person = getUtility(IPersonSet).getByEmail(
145 ... 'test@canonical.com')145 ... 'test@canonical.com')
146 >>> a_bugtracker = bugtracker_set.ensureBugTracker(146 >>> a_bugtracker = bugtracker_set.ensureBugTracker(
@@ -325,8 +325,8 @@
325325
326We will forge some BugMessage records before trying again:326We will forge some BugMessage records before trying again:
327327
328 >>> from zope.security.proxy import removeSecurityProxy
328 >>> from lp.bugs.interfaces.bugmessage import IBugMessageSet329 >>> from lp.bugs.interfaces.bugmessage import IBugMessageSet
329 >>> from zope.security.proxy import removeSecurityProxy
330330
331 >>> for num, bug_watch in enumerate(mozilla_bugzilla.watches):331 >>> for num, bug_watch in enumerate(mozilla_bugzilla.watches):
332 ... bug_message = getUtility(IBugMessageSet).createMessage(332 ... bug_message = getUtility(IBugMessageSet).createMessage(
333333
=== modified file 'lib/lp/bugs/doc/bugwatch.txt'
--- lib/lp/bugs/doc/bugwatch.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/doc/bugwatch.txt 2010-10-21 19:08:55 +0000
@@ -59,8 +59,9 @@
59Watches of Email Address bugtrackers are slightly different: the `url`59Watches of Email Address bugtrackers are slightly different: the `url`
60property is always the same as the bugtracker baseurl property.60property is always the same as the bugtracker baseurl property.
6161
62 >>> from canonical.launchpad.interfaces import (62 >>> from lp.bugs.interfaces.bug import IBugSet
63 ... IBugSet, IBugTrackerSet, IPersonSet)63 >>> from lp.bugs.interfaces.bugtracker import IBugTrackerSet
64 >>> from lp.registry.interfaces.person import IPersonSet
64 >>> bugtrackerset = getUtility(IBugTrackerSet)65 >>> bugtrackerset = getUtility(IBugTrackerSet)
6566
66 >>> email_bugtracker = bugtrackerset['email']67 >>> email_bugtracker = bugtrackerset['email']
@@ -267,8 +268,8 @@
267 ... print "%s => %s" % (old_bugtask.importance.title,268 ... print "%s => %s" % (old_bugtask.importance.title,
268 ... bugtask.importance.title)269 ... bugtask.importance.title)
269 >>> from canonical.launchpad.ftests.event import TestEventListener270 >>> from canonical.launchpad.ftests.event import TestEventListener
271 >>> from lazr.lifecycle.interfaces import IObjectModifiedEvent
270 >>> from lp.bugs.interfaces.bugtask import IBugTask272 >>> from lp.bugs.interfaces.bugtask import IBugTask
271 >>> from lazr.lifecycle.interfaces import IObjectModifiedEvent
272 >>> event_listener = TestEventListener(273 >>> event_listener = TestEventListener(
273 ... IBugTask, IObjectModifiedEvent, print_bugtask_modified)274 ... IBugTask, IObjectModifiedEvent, print_bugtask_modified)
274275
@@ -417,9 +418,13 @@
417418
418 >>> from zope.component import getUtility419 >>> from zope.component import getUtility
419 >>> from canonical.database.sqlbase import flush_database_updates420 >>> from canonical.database.sqlbase import flush_database_updates
420 >>> from canonical.launchpad.interfaces import (421 >>> from lp.bugs.interfaces.bug import CreateBugParams
421 ... CreateBugParams, BugTrackerType, IBugTaskSet,422 >>> from lp.bugs.interfaces.bugtask import IBugTaskSet
422 ... IBugTrackerSet, IDistributionSet)423 >>> from lp.bugs.interfaces.bugtracker import (
424 ... BugTrackerType,
425 ... IBugTrackerSet,
426 ... )
427 >>> from lp.registry.interfaces.distribution import IDistributionSet
423428
424 >>> ubuntu = getUtility(IDistributionSet).get(1)429 >>> ubuntu = getUtility(IDistributionSet).get(1)
425 >>> firefox = ubuntu.getSourcePackage('mozilla-firefox')430 >>> firefox = ubuntu.getSourcePackage('mozilla-firefox')
@@ -462,8 +467,8 @@
462 >>> import transaction467 >>> import transaction
463 >>> from lp.bugs.tests.externalbugtracker import (468 >>> from lp.bugs.tests.externalbugtracker import (
464 ... TestRoundup)469 ... TestRoundup)
470 >>> from canonical.launchpad.scripts.logger import FakeLogger
465 >>> from lp.bugs.scripts.checkwatches import CheckwatchesMaster471 >>> from lp.bugs.scripts.checkwatches import CheckwatchesMaster
466 >>> from canonical.launchpad.scripts.logger import FakeLogger
467 >>> bug_watch_updater = CheckwatchesMaster(transaction, FakeLogger())472 >>> bug_watch_updater = CheckwatchesMaster(transaction, FakeLogger())
468 >>> external_bugtracker = TestRoundup(bug_tracker.baseurl)473 >>> external_bugtracker = TestRoundup(bug_tracker.baseurl)
469 >>> bug_watch_updater.updateBugWatches(external_bugtracker, [bug_watch])474 >>> bug_watch_updater.updateBugWatches(external_bugtracker, [bug_watch])
@@ -550,8 +555,8 @@
550next_check time for the watch will be in the past (or in this case is555next_check time for the watch will be in the past (or in this case is
551now) and therefore it will be checked with the next checkwatches run.556now) and therefore it will be checked with the next checkwatches run.
552557
558 >>> from datetime import datetime
553 >>> from pytz import utc559 >>> from pytz import utc
554 >>> from datetime import datetime
555 >>> schedulable_watch.next_check = datetime.now(utc)560 >>> schedulable_watch.next_check = datetime.now(utc)
556 >>> schedulable_watch.can_be_rescheduled561 >>> schedulable_watch.can_be_rescheduled
557 False562 False
558563
=== modified file 'lib/lp/bugs/doc/bugwidget.txt'
--- lib/lp/bugs/doc/bugwidget.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/doc/bugwidget.txt 2010-10-21 19:08:55 +0000
@@ -3,8 +3,8 @@
3The BugWidget converts string bug ids to the corresponding bug object.3The BugWidget converts string bug ids to the corresponding bug object.
44
5 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest5 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
6 >>> from canonical.widgets.bug import BugWidget
6 >>> from lp.services.fields import BugField7 >>> from lp.services.fields import BugField
7 >>> from canonical.widgets.bug import BugWidget
8 >>> bug_field = BugField(__name__='bug', title=u'Bug')8 >>> bug_field = BugField(__name__='bug', title=u'Bug')
9 >>> request = LaunchpadTestRequest(form={'field.bug': '1'})9 >>> request = LaunchpadTestRequest(form={'field.bug': '1'})
10 >>> bug_widget = BugWidget(bug_field, request)10 >>> bug_widget = BugWidget(bug_field, request)
1111
=== modified file 'lib/lp/bugs/doc/bugzilla-import.txt'
--- lib/lp/bugs/doc/bugzilla-import.txt 2010-10-03 15:30:06 +0000
+++ lib/lp/bugs/doc/bugzilla-import.txt 2010-10-21 19:08:55 +0000
@@ -106,9 +106,10 @@
106106
107 >>> from zope.component import getUtility107 >>> from zope.component import getUtility
108 >>> from canonical.launchpad.ftests import login108 >>> from canonical.launchpad.ftests import login
109 >>> from canonical.launchpad.interfaces import (109 >>> from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities
110 ... IBugSet, ILaunchpadCelebrities, IPersonSet)110 >>> from lp.bugs.interfaces.bug import IBugSet
111 >>> from lp.bugs.scripts import bugzilla111 >>> from lp.bugs.scripts import bugzilla
112 >>> from lp.registry.interfaces.person import IPersonSet
112113
113Get a reference to the Ubuntu bug tracker, and log in:114Get a reference to the Ubuntu bug tracker, and log in:
114115
115116
=== modified file 'lib/lp/bugs/doc/checkwatches-batching.txt'
--- lib/lp/bugs/doc/checkwatches-batching.txt 2010-04-21 10:30:24 +0000
+++ lib/lp/bugs/doc/checkwatches-batching.txt 2010-10-21 19:08:55 +0000
@@ -67,9 +67,9 @@
67For bug watches that have been checked before, the remote system is67For bug watches that have been checked before, the remote system is
68asked which of a list of bugs have been modified since a given date.68asked which of a list of bugs have been modified since a given date.
6969
70 >>> from zope.security.proxy import removeSecurityProxy
70 >>> from datetime import datetime71 >>> from datetime import datetime
71 >>> from pytz import UTC72 >>> from pytz import UTC
72 >>> from zope.security.proxy import removeSecurityProxy
7373
74 >>> class QueryableRemoteSystem:74 >>> class QueryableRemoteSystem:
75 ... sync_comments = False75 ... sync_comments = False
7676
=== modified file 'lib/lp/bugs/doc/checkwatches-cli-switches.txt'
--- lib/lp/bugs/doc/checkwatches-cli-switches.txt 2010-10-04 19:50:45 +0000
+++ lib/lp/bugs/doc/checkwatches-cli-switches.txt 2010-10-21 19:08:55 +0000
@@ -87,8 +87,8 @@
8787
88 >>> import pytz88 >>> import pytz
89 >>> from datetime import datetime89 >>> from datetime import datetime
90 >>> from lp.bugs.interfaces.bugtracker import IBugTrackerSet
90 >>> from lp.testing.factory import LaunchpadObjectFactory91 >>> from lp.testing.factory import LaunchpadObjectFactory
91 >>> from lp.bugs.interfaces.bugtracker import IBugTrackerSet
9292
93 >>> factory = LaunchpadObjectFactory()93 >>> factory = LaunchpadObjectFactory()
94 >>> LaunchpadZopelessLayer.switchDbUser('launchpad')94 >>> LaunchpadZopelessLayer.switchDbUser('launchpad')
9595
=== modified file 'lib/lp/bugs/doc/checkwatches.txt'
--- lib/lp/bugs/doc/checkwatches.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/doc/checkwatches.txt 2010-10-21 19:08:55 +0000
@@ -20,8 +20,8 @@
2020
21 >>> from canonical.config import config21 >>> from canonical.config import config
22 >>> from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities22 >>> from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities
23 >>> from canonical.testing.layers import LaunchpadZopelessLayer
23 >>> from lp.testing.factory import LaunchpadObjectFactory24 >>> from lp.testing.factory import LaunchpadObjectFactory
24 >>> from canonical.testing.layers import LaunchpadZopelessLayer
2525
26 >>> LaunchpadZopelessLayer.switchDbUser('launchpad')26 >>> LaunchpadZopelessLayer.switchDbUser('launchpad')
2727
@@ -104,14 +104,13 @@
104First, we create some bug watches to test with:104First, we create some bug watches to test with:
105105
106 >>> from datetime import datetime106 >>> from datetime import datetime
107 >>> from lp.bugs.interfaces.bug import IBugSet
108 >>> from lp.bugs.interfaces.bugtracker import BugTrackerType
109 >>> from lp.bugs.model.bugtracker import BugTracker
107 >>> from pytz import utc110 >>> from pytz import utc
108 >>> from lp.bugs.model.bugtracker import BugTracker
109 >>> from canonical.launchpad.interfaces import (
110 ... BugTrackerType, IBugSet)
111 >>> from lp.bugs.scripts.checkwatches import (111 >>> from lp.bugs.scripts.checkwatches import (
112 ... CheckwatchesMaster)112 ... CheckwatchesMaster)
113 >>> from canonical.launchpad.interfaces import (113 >>> from lp.registry.interfaces.person import IPersonSet
114 ... IPersonSet)
115 >>> sample_person = getUtility(IPersonSet).getByEmail(114 >>> sample_person = getUtility(IPersonSet).getByEmail(
116 ... 'test@canonical.com')115 ... 'test@canonical.com')
117116
@@ -257,8 +256,8 @@
257batch size. We will also monkey-patch urllib2.urlopen again so that no256batch size. We will also monkey-patch urllib2.urlopen again so that no
258requests are actually made.257requests are actually made.
259258
260 >>> from lp.bugs import externalbugtracker
261 >>> from canonical.launchpad.scripts import FakeLogger259 >>> from canonical.launchpad.scripts import FakeLogger
260 >>> from lp.bugs import externalbugtracker
262261
263 >>> transaction.commit()262 >>> transaction.commit()
264 >>> updater = CheckwatchesMaster(transaction.manager)263 >>> updater = CheckwatchesMaster(transaction.manager)
265264
=== modified file 'lib/lp/bugs/doc/displaying-bugs-and-tasks.txt'
--- lib/lp/bugs/doc/displaying-bugs-and-tasks.txt 2010-10-11 16:17:45 +0000
+++ lib/lp/bugs/doc/displaying-bugs-and-tasks.txt 2010-10-21 19:08:55 +0000
@@ -16,8 +16,10 @@
16 >>> from zope.component import getUtility16 >>> from zope.component import getUtility
17 >>> from canonical.launchpad.webapp.interfaces import ILaunchBag17 >>> from canonical.launchpad.webapp.interfaces import ILaunchBag
18 >>> from lp.bugs.interfaces.bugtask import BugTaskImportance, IBugTaskSet18 >>> from lp.bugs.interfaces.bugtask import BugTaskImportance, IBugTaskSet
19 >>> from canonical.launchpad.ftests import test_tales19 >>> from canonical.launchpad.ftests import (
20 >>> from canonical.launchpad.ftests import login20 ... login,
21 ... test_tales,
22 ... )
2123
22 >>> login("foo.bar@canonical.com")24 >>> login("foo.bar@canonical.com")
23 >>> bugtaskset = getUtility(IBugTaskSet)25 >>> bugtaskset = getUtility(IBugTaskSet)
@@ -97,10 +99,10 @@
97We define a helper that uses the BugTaskListingView class (obtained via99We define a helper that uses the BugTaskListingView class (obtained via
98+listing-view) to render the status:100+listing-view) to render the status:
99101
100 >>> from canonical.launchpad.webapp.interfaces import ILaunchBag
101 >>> from lp.bugs.interfaces.bugtask import BugTaskStatus
102 >>> from zope.component import getMultiAdapter102 >>> from zope.component import getMultiAdapter
103 >>> from canonical.launchpad.webapp.interfaces import ILaunchBag
103 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest104 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
105 >>> from lp.bugs.interfaces.bugtask import BugTaskStatus
104106
105 >>> def render_bugtask_status(task):107 >>> def render_bugtask_status(task):
106 ... view = getMultiAdapter(108 ... view = getMultiAdapter(
107109
=== modified file 'lib/lp/bugs/doc/externalbugtracker-bug-imports.txt'
--- lib/lp/bugs/doc/externalbugtracker-bug-imports.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/doc/externalbugtracker-bug-imports.txt 2010-10-21 19:08:55 +0000
@@ -24,8 +24,8 @@
24 ... def getBugTargetName(self, remote_bug):24 ... def getBugTargetName(self, remote_bug):
25 ... return self._bugs[remote_bug]['package']25 ... return self._bugs[remote_bug]['package']
2626
27 >>> from canonical.launchpad.interfaces import (27 >>> from lp.bugs.interfaces.bugtracker import BugTrackerType
28 ... BugTrackerType, IDistributionSet)28 >>> from lp.registry.interfaces.distribution import IDistributionSet
29 >>> from lp.bugs.tests.externalbugtracker import (29 >>> from lp.bugs.tests.externalbugtracker import (
30 ... new_bugtracker)30 ... new_bugtracker)
31 >>> bugtracker = new_bugtracker(BugTrackerType.BUGZILLA)31 >>> bugtracker = new_bugtracker(BugTrackerType.BUGZILLA)
@@ -45,8 +45,8 @@
45imported into, and the remote bug number. At the moment only45imported into, and the remote bug number. At the moment only
46distributions are supported as the bug target.46distributions are supported as the bug target.
4747
48 >>> from canonical.testing.layers import LaunchpadZopelessLayer
48 >>> from lp.bugs.scripts.checkwatches import CheckwatchesMaster49 >>> from lp.bugs.scripts.checkwatches import CheckwatchesMaster
49 >>> from canonical.testing.layers import LaunchpadZopelessLayer
50 >>> debian = getUtility(IDistributionSet).getByName('debian')50 >>> debian = getUtility(IDistributionSet).getByName('debian')
51 >>> external_bugtracker._bugs['3'] = {51 >>> external_bugtracker._bugs['3'] = {
52 ... 'package': 'evolution',52 ... 'package': 'evolution',
5353
=== modified file 'lib/lp/bugs/doc/externalbugtracker-bugzilla-api.txt'
--- lib/lp/bugs/doc/externalbugtracker-bugzilla-api.txt 2010-10-15 20:45:24 +0000
+++ lib/lp/bugs/doc/externalbugtracker-bugzilla-api.txt 2010-10-21 19:08:55 +0000
@@ -386,8 +386,8 @@
386means that we can use it to import comments from the remote Bugzilla386means that we can use it to import comments from the remote Bugzilla
387instance.387instance.
388388
389 >>> from canonical.launchpad.webapp.testing import verifyObject
389 >>> from lp.bugs.interfaces.externalbugtracker import ISupportsCommentImport390 >>> from lp.bugs.interfaces.externalbugtracker import ISupportsCommentImport
390 >>> from canonical.launchpad.webapp.testing import verifyObject
391 >>> verifyObject(ISupportsCommentImport, bugzilla)391 >>> verifyObject(ISupportsCommentImport, bugzilla)
392 True392 True
393393
394394
=== modified file 'lib/lp/bugs/doc/externalbugtracker-bugzilla-lp-plugin.txt'
--- lib/lp/bugs/doc/externalbugtracker-bugzilla-lp-plugin.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/doc/externalbugtracker-bugzilla-lp-plugin.txt 2010-10-21 19:08:55 +0000
@@ -334,8 +334,8 @@
334means that we can use it to import comments from the remote Bugzilla334means that we can use it to import comments from the remote Bugzilla
335instance.335instance.
336336
337 >>> from canonical.launchpad.webapp.testing import verifyObject
337 >>> from lp.bugs.interfaces.externalbugtracker import ISupportsCommentImport338 >>> from lp.bugs.interfaces.externalbugtracker import ISupportsCommentImport
338 >>> from canonical.launchpad.webapp.testing import verifyObject
339 >>> verifyObject(ISupportsCommentImport, bugzilla)339 >>> verifyObject(ISupportsCommentImport, bugzilla)
340 True340 True
341341
342342
=== modified file 'lib/lp/bugs/doc/externalbugtracker-bugzilla-oddities.txt'
--- lib/lp/bugs/doc/externalbugtracker-bugzilla-oddities.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/doc/externalbugtracker-bugzilla-oddities.txt 2010-10-21 19:08:55 +0000
@@ -14,9 +14,9 @@
1414
15 >>> from lp.bugs.interfaces.bugtracker import IBugTrackerSet15 >>> from lp.bugs.interfaces.bugtracker import IBugTrackerSet
1616
17 >>> from canonical.testing.layers import LaunchpadZopelessLayer
18 >>> from lp.bugs.scripts.checkwatches import CheckwatchesMaster
17 >>> from lp.bugs.tests.externalbugtracker import TestIssuezilla19 >>> from lp.bugs.tests.externalbugtracker import TestIssuezilla
18 >>> from lp.bugs.scripts.checkwatches import CheckwatchesMaster
19 >>> from canonical.testing.layers import LaunchpadZopelessLayer
20 >>> txn = LaunchpadZopelessLayer.txn20 >>> txn = LaunchpadZopelessLayer.txn
21 >>> mozilla_bugzilla = getUtility(IBugTrackerSet).getByName('mozilla.org')21 >>> mozilla_bugzilla = getUtility(IBugTrackerSet).getByName('mozilla.org')
22 >>> issuezilla = TestIssuezilla(mozilla_bugzilla.baseurl)22 >>> issuezilla = TestIssuezilla(mozilla_bugzilla.baseurl)
2323
=== modified file 'lib/lp/bugs/doc/externalbugtracker-bugzilla.txt'
--- lib/lp/bugs/doc/externalbugtracker-bugzilla.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/doc/externalbugtracker-bugzilla.txt 2010-10-21 19:08:55 +0000
@@ -58,8 +58,8 @@
58Since we don't want to depend on a working network connection, we use a58Since we don't want to depend on a working network connection, we use a
59slightly modified implementation.59slightly modified implementation.
6060
61 >>> from lp.bugs.interfaces.bugtracker import IBugTrackerSet
61 >>> from lp.bugs.tests.externalbugtracker import TestBugzilla62 >>> from lp.bugs.tests.externalbugtracker import TestBugzilla
62 >>> from lp.bugs.interfaces.bugtracker import IBugTrackerSet
63 >>> gnome_bugzilla = (63 >>> gnome_bugzilla = (
64 ... getUtility(IBugTrackerSet).getByName('gnome-bugzilla'))64 ... getUtility(IBugTrackerSet).getByName('gnome-bugzilla'))
65 >>> external_bugzilla = TestBugzilla(gnome_bugzilla.baseurl)65 >>> external_bugzilla = TestBugzilla(gnome_bugzilla.baseurl)
@@ -430,8 +430,9 @@
430430
431Let's add a handful of watches:431Let's add a handful of watches:
432432
433 >>> from canonical.launchpad.interfaces import (433 >>> from lp.bugs.interfaces.bug import IBugSet
434 ... IBugSet, IBugWatchSet, IPersonSet)434 >>> from lp.bugs.interfaces.bugwatch import IBugWatchSet
435 >>> from lp.registry.interfaces.person import IPersonSet
435 >>> sample_person = getUtility(IPersonSet).getByEmail(436 >>> sample_person = getUtility(IPersonSet).getByEmail(
436 ... 'test@canonical.com')437 ... 'test@canonical.com')
437 >>> bug_one = getUtility(IBugSet).get(1)438 >>> bug_one = getUtility(IBugSet).get(1)
438439
=== modified file 'lib/lp/bugs/doc/externalbugtracker-comment-imports.txt'
--- lib/lp/bugs/doc/externalbugtracker-comment-imports.txt 2010-10-04 19:50:45 +0000
+++ lib/lp/bugs/doc/externalbugtracker-comment-imports.txt 2010-10-21 19:08:55 +0000
@@ -10,10 +10,14 @@
10 >>> from canonical.config import config10 >>> from canonical.config import config
11 >>> from lp.bugs.tests.externalbugtracker import (11 >>> from lp.bugs.tests.externalbugtracker import (
12 ... new_bugtracker)12 ... new_bugtracker)
13 >>> from canonical.launchpad.interfaces import (13 >>> from canonical.launchpad.interfaces.message import IMessageSet
14 ... BugTrackerType, CreateBugParams, IBugMessageSet,
15 ... IBugWatchSet, IMessageSet, IPersonSet, IProductSet)
16 >>> from canonical.testing.layers import LaunchpadZopelessLayer14 >>> from canonical.testing.layers import LaunchpadZopelessLayer
15 >>> from lp.bugs.interfaces.bug import CreateBugParams
16 >>> from lp.bugs.interfaces.bugmessage import IBugMessageSet
17 >>> from lp.bugs.interfaces.bugtracker import BugTrackerType
18 >>> from lp.bugs.interfaces.bugwatch import IBugWatchSet
19 >>> from lp.registry.interfaces.person import IPersonSet
20 >>> from lp.registry.interfaces.product import IProductSet
1721
18 >>> bug_tracker = new_bugtracker(BugTrackerType.BUGZILLA)22 >>> bug_tracker = new_bugtracker(BugTrackerType.BUGZILLA)
1923
@@ -41,8 +45,7 @@
4145
42 >>> from lp.bugs.externalbugtracker import (46 >>> from lp.bugs.externalbugtracker import (
43 ... ExternalBugTracker)47 ... ExternalBugTracker)
44 >>> from canonical.launchpad.interfaces import (48 >>> from lp.bugs.interfaces.externalbugtracker import ISupportsCommentImport
45 ... ISupportsCommentImport)
46 >>> class CommentImportingExternalBugTracker(ExternalBugTracker):49 >>> class CommentImportingExternalBugTracker(ExternalBugTracker):
47 ... implements(ISupportsCommentImport)50 ... implements(ISupportsCommentImport)
48 ...51 ...
4952
=== modified file 'lib/lp/bugs/doc/externalbugtracker-comment-pushing.txt'
--- lib/lp/bugs/doc/externalbugtracker-comment-pushing.txt 2010-10-04 19:50:45 +0000
+++ lib/lp/bugs/doc/externalbugtracker-comment-pushing.txt 2010-10-21 19:08:55 +0000
@@ -10,10 +10,14 @@
10 >>> from canonical.config import config10 >>> from canonical.config import config
11 >>> from lp.bugs.tests.externalbugtracker import (11 >>> from lp.bugs.tests.externalbugtracker import (
12 ... new_bugtracker)12 ... new_bugtracker)
13 >>> from canonical.launchpad.interfaces import (13 >>> from canonical.launchpad.interfaces.message import IMessageSet
14 ... BugTrackerType, CreateBugParams, IBugMessageSet,
15 ... IBugWatchSet, IMessageSet, IPersonSet, IProductSet)
16 >>> from canonical.testing.layers import LaunchpadZopelessLayer14 >>> from canonical.testing.layers import LaunchpadZopelessLayer
15 >>> from lp.bugs.interfaces.bug import CreateBugParams
16 >>> from lp.bugs.interfaces.bugmessage import IBugMessageSet
17 >>> from lp.bugs.interfaces.bugtracker import BugTrackerType
18 >>> from lp.bugs.interfaces.bugwatch import IBugWatchSet
19 >>> from lp.registry.interfaces.person import IPersonSet
20 >>> from lp.registry.interfaces.product import IProductSet
1721
18 >>> bug_tracker = new_bugtracker(BugTrackerType.TRAC)22 >>> bug_tracker = new_bugtracker(BugTrackerType.TRAC)
1923
@@ -46,8 +50,7 @@
46an example ExternalBugTracker that implements the50an example ExternalBugTracker that implements the
47ISupportsCommentPushing interface.51ISupportsCommentPushing interface.
4852
49 >>> from canonical.launchpad.interfaces import (53 >>> from lp.bugs.interfaces.externalbugtracker import ISupportsCommentPushing
50 ... ISupportsCommentPushing)
51 >>> from lp.bugs.externalbugtracker import (54 >>> from lp.bugs.externalbugtracker import (
52 ... ExternalBugTracker)55 ... ExternalBugTracker)
5356
@@ -187,8 +190,7 @@
187from the remote bugtracker. To demonstrate this, we need to create an190from the remote bugtracker. To demonstrate this, we need to create an
188example ExternalBugTracker that does comment importing.191example ExternalBugTracker that does comment importing.
189192
190 >>> from canonical.launchpad.interfaces import (193 >>> from lp.bugs.interfaces.externalbugtracker import ISupportsCommentImport
191 ... ISupportsCommentImport)
192 >>> class CommentImportingExternalBugTracker(194 >>> class CommentImportingExternalBugTracker(
193 ... CommentPushingExternalBugTracker):195 ... CommentPushingExternalBugTracker):
194 ... implements(ISupportsCommentImport)196 ... implements(ISupportsCommentImport)
195197
=== modified file 'lib/lp/bugs/doc/externalbugtracker-debbugs.txt'
--- lib/lp/bugs/doc/externalbugtracker-debbugs.txt 2010-10-11 16:17:45 +0000
+++ lib/lp/bugs/doc/externalbugtracker-debbugs.txt 2010-10-21 19:08:55 +0000
@@ -6,8 +6,8 @@
6test:6test:
77
8 >>> import os.path8 >>> import os.path
9 >>> from canonical.config import config
9 >>> from canonical.launchpad.components.ftests import __file__10 >>> from canonical.launchpad.components.ftests import __file__
10 >>> from canonical.config import config
11 >>> test_db_location = os.path.join(11 >>> test_db_location = os.path.join(
12 ... os.path.dirname(__file__), 'debbugs_db')12 ... os.path.dirname(__file__), 'debbugs_db')
1313
@@ -348,8 +348,8 @@
348348
349 >>> from lp.bugs.externalbugtracker import (349 >>> from lp.bugs.externalbugtracker import (
350 ... get_external_bugtracker)350 ... get_external_bugtracker)
351 >>> from canonical.launchpad.interfaces import (351 >>> from lp.bugs.interfaces.bugtracker import BugTrackerType
352 ... BugTrackerType, ISupportsCommentImport)352 >>> from lp.bugs.interfaces.externalbugtracker import ISupportsCommentImport
353 >>> from lp.bugs.tests.externalbugtracker import (353 >>> from lp.bugs.tests.externalbugtracker import (
354 ... new_bugtracker)354 ... new_bugtracker)
355 >>> external_debbugs = get_external_bugtracker(355 >>> external_debbugs = get_external_bugtracker(
@@ -438,8 +438,10 @@
438Message. It requires a Person instance to be used as the Message's438Message. It requires a Person instance to be used as the Message's
439owner, so we'll turn Teun Vink into a Person.439owner, so we'll turn Teun Vink into a Person.
440440
441 >>> from canonical.launchpad.interfaces import (441 >>> from lp.registry.interfaces.person import (
442 ... IPersonSet, PersonCreationRationale)442 ... IPersonSet,
443 ... PersonCreationRationale,
444 ... )
443 >>> poster = getUtility(IPersonSet).ensurePerson(445 >>> poster = getUtility(IPersonSet).ensurePerson(
444 ... poster_email, poster_name, PersonCreationRationale.BUGIMPORT,446 ... poster_email, poster_name, PersonCreationRationale.BUGIMPORT,
445 ... comment='when importing comments for %s.' % bug_watch.title)447 ... comment='when importing comments for %s.' % bug_watch.title)
446448
=== modified file 'lib/lp/bugs/doc/externalbugtracker-emailaddress.txt'
--- lib/lp/bugs/doc/externalbugtracker-emailaddress.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/doc/externalbugtracker-emailaddress.txt 2010-10-21 19:08:55 +0000
@@ -33,8 +33,11 @@
3333
34 >>> from zope.component import getUtility34 >>> from zope.component import getUtility
35 >>> from canonical.launchpad.webapp.testing import verifyObject35 >>> from canonical.launchpad.webapp.testing import verifyObject
36 >>> from canonical.launchpad.interfaces import (36 >>> from lp.bugs.interfaces.bugtracker import (
37 ... IBugTracker, IBugTrackerSet, IPersonSet)37 ... IBugTracker,
38 ... IBugTrackerSet,
39 ... )
40 >>> from lp.registry.interfaces.person import IPersonSet
3841
39 >>> sample_person = getUtility(IPersonSet).getByEmail(42 >>> sample_person = getUtility(IPersonSet).getByEmail(
40 ... 'test@canonical.com')43 ... 'test@canonical.com')
4144
=== modified file 'lib/lp/bugs/doc/externalbugtracker-mantis-csv.txt'
--- lib/lp/bugs/doc/externalbugtracker-mantis-csv.txt 2010-10-11 16:17:45 +0000
+++ lib/lp/bugs/doc/externalbugtracker-mantis-csv.txt 2010-10-21 19:08:55 +0000
@@ -53,8 +53,8 @@
5353
54 >>> sample_person = getUtility(IPersonSet).getByEmail('test@canonical.com')54 >>> sample_person = getUtility(IPersonSet).getByEmail('test@canonical.com')
5555
56 >>> from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities
56 >>> from lp.bugs.interfaces.bugtracker import BugTrackerType57 >>> from lp.bugs.interfaces.bugtracker import BugTrackerType
57 >>> from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities
58 >>> from lp.bugs.tests.externalbugtracker import (58 >>> from lp.bugs.tests.externalbugtracker import (
59 ... new_bugtracker)59 ... new_bugtracker)
60 >>> example_bug_tracker = new_bugtracker(BugTrackerType.MANTIS)60 >>> example_bug_tracker = new_bugtracker(BugTrackerType.MANTIS)
6161
=== modified file 'lib/lp/bugs/doc/externalbugtracker-mantis.txt'
--- lib/lp/bugs/doc/externalbugtracker-mantis.txt 2010-10-11 16:17:45 +0000
+++ lib/lp/bugs/doc/externalbugtracker-mantis.txt 2010-10-21 19:08:55 +0000
@@ -13,9 +13,9 @@
13 >>> from lp.bugs.externalbugtracker import Mantis13 >>> from lp.bugs.externalbugtracker import Mantis
14 >>> from lp.bugs.tests.externalbugtracker import (14 >>> from lp.bugs.tests.externalbugtracker import (
15 ... new_bugtracker)15 ... new_bugtracker)
16 >>> from canonical.launchpad.interfaces import (
17 ... BugTrackerType, IExternalBugTracker)
18 >>> from canonical.launchpad.webapp.testing import verifyObject16 >>> from canonical.launchpad.webapp.testing import verifyObject
17 >>> from lp.bugs.interfaces.bugtracker import BugTrackerType
18 >>> from lp.bugs.interfaces.externalbugtracker import IExternalBugTracker
19 >>> alsa_mantis = Mantis('http://example.com/')19 >>> alsa_mantis = Mantis('http://example.com/')
2020
21 >>> verifyObject(IExternalBugTracker, alsa_mantis)21 >>> verifyObject(IExternalBugTracker, alsa_mantis)
@@ -80,8 +80,8 @@
8080
81 >>> transaction.commit()81 >>> transaction.commit()
8282
83 >>> from canonical.testing.layers import LaunchpadZopelessLayer
83 >>> from lp.bugs.scripts.checkwatches import CheckwatchesMaster84 >>> from lp.bugs.scripts.checkwatches import CheckwatchesMaster
84 >>> from canonical.testing.layers import LaunchpadZopelessLayer
85 >>> txn = LaunchpadZopelessLayer.txn85 >>> txn = LaunchpadZopelessLayer.txn
86 >>> bug_watch_updater = CheckwatchesMaster(txn)86 >>> bug_watch_updater = CheckwatchesMaster(txn)
87 >>> bug_watch_updater.updateBugWatches(87 >>> bug_watch_updater.updateBugWatches(
8888
=== modified file 'lib/lp/bugs/doc/externalbugtracker-roundup.txt'
--- lib/lp/bugs/doc/externalbugtracker-roundup.txt 2010-10-11 16:17:45 +0000
+++ lib/lp/bugs/doc/externalbugtracker-roundup.txt 2010-10-21 19:08:55 +0000
@@ -11,8 +11,8 @@
11implements IExternalBugTracker.11implements IExternalBugTracker.
1212
13 >>> from lp.bugs.externalbugtracker import Roundup13 >>> from lp.bugs.externalbugtracker import Roundup
14 >>> from canonical.launchpad.interfaces import (14 >>> from lp.bugs.interfaces.bugtracker import BugTrackerType
15 ... BugTrackerType, IExternalBugTracker)15 >>> from lp.bugs.interfaces.externalbugtracker import IExternalBugTracker
16 >>> from lp.bugs.tests.externalbugtracker import (16 >>> from lp.bugs.tests.externalbugtracker import (
17 ... new_bugtracker)17 ... new_bugtracker)
18 >>> from canonical.launchpad.webapp.testing import verifyObject18 >>> from canonical.launchpad.webapp.testing import verifyObject
@@ -138,8 +138,8 @@
138138
139 >>> transaction.commit()139 >>> transaction.commit()
140140
141 >>> from canonical.testing.layers import LaunchpadZopelessLayer
141 >>> from lp.bugs.scripts.checkwatches import CheckwatchesMaster142 >>> from lp.bugs.scripts.checkwatches import CheckwatchesMaster
142 >>> from canonical.testing.layers import LaunchpadZopelessLayer
143 >>> txn = LaunchpadZopelessLayer.txn143 >>> txn = LaunchpadZopelessLayer.txn
144 >>> bug_watch_updater = CheckwatchesMaster(txn)144 >>> bug_watch_updater = CheckwatchesMaster(txn)
145 >>> roundup = TestRoundup(example_bug_tracker.baseurl)145 >>> roundup = TestRoundup(example_bug_tracker.baseurl)
146146
=== modified file 'lib/lp/bugs/doc/externalbugtracker-rt.txt'
--- lib/lp/bugs/doc/externalbugtracker-rt.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/doc/externalbugtracker-rt.txt 2010-10-21 19:08:55 +0000
@@ -11,8 +11,8 @@
1111
12 >>> from lp.bugs.externalbugtracker import (12 >>> from lp.bugs.externalbugtracker import (
13 ... RequestTracker)13 ... RequestTracker)
14 >>> from canonical.launchpad.interfaces import (14 >>> from lp.bugs.interfaces.bugtracker import BugTrackerType
15 ... BugTrackerType, IExternalBugTracker)15 >>> from lp.bugs.interfaces.externalbugtracker import IExternalBugTracker
16 >>> from lp.bugs.tests.externalbugtracker import (16 >>> from lp.bugs.tests.externalbugtracker import (
17 ... new_bugtracker)17 ... new_bugtracker)
18 >>> from canonical.launchpad.webapp.testing import verifyObject18 >>> from canonical.launchpad.webapp.testing import verifyObject
@@ -155,8 +155,9 @@
155First, we create some bug watches to test with. Example.com hosts an RT155First, we create some bug watches to test with. Example.com hosts an RT
156instance which has several bugs that we wish to watch:156instance which has several bugs that we wish to watch:
157157
158 >>> from canonical.launchpad.interfaces import (158 >>> from lp.bugs.interfaces.bug import IBugSet
159 ... IBugSet, IBugWatchSet, IPersonSet)159 >>> from lp.bugs.interfaces.bugwatch import IBugWatchSet
160 >>> from lp.registry.interfaces.person import IPersonSet
160 >>> from lp.bugs.tests.externalbugtracker import (161 >>> from lp.bugs.tests.externalbugtracker import (
161 ... print_bugwatches)162 ... print_bugwatches)
162163
@@ -180,8 +181,8 @@
180181
181 >>> transaction.commit()182 >>> transaction.commit()
182183
184 >>> from canonical.testing.layers import LaunchpadZopelessLayer
183 >>> from lp.bugs.scripts.checkwatches import CheckwatchesMaster185 >>> from lp.bugs.scripts.checkwatches import CheckwatchesMaster
184 >>> from canonical.testing.layers import LaunchpadZopelessLayer
185 >>> txn = LaunchpadZopelessLayer.txn186 >>> txn = LaunchpadZopelessLayer.txn
186 >>> bug_watch_updater = CheckwatchesMaster(txn)187 >>> bug_watch_updater = CheckwatchesMaster(txn)
187 >>> rt = TestRequestTracker(example_bug_tracker.baseurl)188 >>> rt = TestRequestTracker(example_bug_tracker.baseurl)
188189
=== modified file 'lib/lp/bugs/doc/externalbugtracker-sourceforge.txt'
--- lib/lp/bugs/doc/externalbugtracker-sourceforge.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/doc/externalbugtracker-sourceforge.txt 2010-10-21 19:08:55 +0000
@@ -12,9 +12,9 @@
1212
13 >>> from lp.bugs.externalbugtracker import (13 >>> from lp.bugs.externalbugtracker import (
14 ... SourceForge)14 ... SourceForge)
15 >>> from canonical.launchpad.interfaces import (
16 ... BugTrackerType, IExternalBugTracker)
17 >>> from canonical.launchpad.webapp.testing import verifyObject15 >>> from canonical.launchpad.webapp.testing import verifyObject
16 >>> from lp.bugs.interfaces.bugtracker import BugTrackerType
17 >>> from lp.bugs.interfaces.externalbugtracker import IExternalBugTracker
18 >>> verifyObject(IExternalBugTracker,18 >>> verifyObject(IExternalBugTracker,
19 ... SourceForge('http://example.com'))19 ... SourceForge('http://example.com'))
20 True20 True
@@ -161,8 +161,8 @@
161161
162 >>> transaction.commit()162 >>> transaction.commit()
163163
164 >>> from canonical.testing.layers import LaunchpadZopelessLayer
164 >>> from lp.bugs.scripts.checkwatches import CheckwatchesMaster165 >>> from lp.bugs.scripts.checkwatches import CheckwatchesMaster
165 >>> from canonical.testing.layers import LaunchpadZopelessLayer
166 >>> txn = LaunchpadZopelessLayer.txn166 >>> txn = LaunchpadZopelessLayer.txn
167 >>> bug_watch_updater = CheckwatchesMaster(txn)167 >>> bug_watch_updater = CheckwatchesMaster(txn)
168 >>> sourceforge = TestSourceForge(example_bug_tracker.baseurl)168 >>> sourceforge = TestSourceForge(example_bug_tracker.baseurl)
169169
=== modified file 'lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt'
--- lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt 2010-10-21 19:08:55 +0000
@@ -31,8 +31,8 @@
3131
32 >>> import random32 >>> import random
33 >>> from canonical.config import config33 >>> from canonical.config import config
34 >>> from canonical.launchpad.interfaces.logintoken import ILoginTokenSet
34 >>> from canonical.launchpad.webapp.url import urlappend35 >>> from canonical.launchpad.webapp.url import urlappend
35 >>> from canonical.launchpad.interfaces.logintoken import ILoginTokenSet
36 >>> from canonical.testing.layers import LaunchpadZopelessLayer36 >>> from canonical.testing.layers import LaunchpadZopelessLayer
3737
38 >>> class FakeResponse:38 >>> class FakeResponse:
@@ -338,8 +338,10 @@
338We also need an example Bug, BugTracker and BugWatch.338We also need an example Bug, BugTracker and BugWatch.
339339
340 >>> from canonical.database.sqlbase import commit340 >>> from canonical.database.sqlbase import commit
341 >>> from canonical.launchpad.interfaces import (341 >>> from lp.bugs.interfaces.bug import CreateBugParams
342 ... BugTrackerType, CreateBugParams, IPersonSet, IProductSet)342 >>> from lp.bugs.interfaces.bugtracker import BugTrackerType
343 >>> from lp.registry.interfaces.person import IPersonSet
344 >>> from lp.registry.interfaces.product import IProductSet
343 >>> from lp.bugs.tests.externalbugtracker import (345 >>> from lp.bugs.tests.externalbugtracker import (
344 ... new_bugtracker)346 ... new_bugtracker)
345347
346348
=== modified file 'lib/lp/bugs/doc/externalbugtracker-trac.txt'
--- lib/lp/bugs/doc/externalbugtracker-trac.txt 2010-10-11 16:17:45 +0000
+++ lib/lp/bugs/doc/externalbugtracker-trac.txt 2010-10-21 19:08:55 +0000
@@ -13,9 +13,9 @@
13 >>> from lp.bugs.externalbugtracker import Trac13 >>> from lp.bugs.externalbugtracker import Trac
14 >>> from lp.bugs.tests.externalbugtracker import (14 >>> from lp.bugs.tests.externalbugtracker import (
15 ... new_bugtracker)15 ... new_bugtracker)
16 >>> from canonical.launchpad.interfaces import (
17 ... BugTrackerType, IExternalBugTracker)
18 >>> from canonical.launchpad.webapp.testing import verifyObject16 >>> from canonical.launchpad.webapp.testing import verifyObject
17 >>> from lp.bugs.interfaces.bugtracker import BugTrackerType
18 >>> from lp.bugs.interfaces.externalbugtracker import IExternalBugTracker
19 >>> trac = Trac('http://example.com/')19 >>> trac = Trac('http://example.com/')
20 >>> verifyObject(IExternalBugTracker, trac)20 >>> verifyObject(IExternalBugTracker, trac)
21 True21 True
@@ -55,9 +55,9 @@
55a valid token, which is very unlikely), is that the broken Trac will55a valid token, which is very unlikely), is that the broken Trac will
56not include a "trac_auth" cookie.56not include a "trac_auth" cookie.
5757
58 >>> from StringIO import StringIO
58 >>> from httplib import HTTPMessage59 >>> from httplib import HTTPMessage
59 >>> from urllib import addinfourl60 >>> from urllib import addinfourl
60 >>> from StringIO import StringIO
6161
62 >>> class TracReturning200ForPageNotFound(Trac):62 >>> class TracReturning200ForPageNotFound(Trac):
63 ... def urlopen(self, url):63 ... def urlopen(self, url):
@@ -298,8 +298,8 @@
298298
299 >>> transaction.commit()299 >>> transaction.commit()
300300
301 >>> from canonical.testing.layers import LaunchpadZopelessLayer
301 >>> from lp.bugs.scripts.checkwatches import CheckwatchesMaster302 >>> from lp.bugs.scripts.checkwatches import CheckwatchesMaster
302 >>> from canonical.testing.layers import LaunchpadZopelessLayer
303 >>> txn = LaunchpadZopelessLayer.txn303 >>> txn = LaunchpadZopelessLayer.txn
304 >>> bug_watch_updater = CheckwatchesMaster(txn)304 >>> bug_watch_updater = CheckwatchesMaster(txn)
305 >>> trac = TestTrac(example_bug_tracker.baseurl)305 >>> trac = TestTrac(example_bug_tracker.baseurl)
306306
=== modified file 'lib/lp/bugs/doc/externalbugtracker.txt'
--- lib/lp/bugs/doc/externalbugtracker.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/doc/externalbugtracker.txt 2010-10-21 19:08:55 +0000
@@ -433,9 +433,9 @@
433getModifiedRemoteBugs(). I.e., if we have a set of newly created bug433getModifiedRemoteBugs(). I.e., if we have a set of newly created bug
434watches, the getModifiedRemoteBugs() method won't be called.434watches, the getModifiedRemoteBugs() method won't be called.
435435
436 >>> from lp.bugs.model.bugtracker import BugTracker
437 >>> from lp.bugs.interfaces.bug import IBugSet436 >>> from lp.bugs.interfaces.bug import IBugSet
438 >>> from lp.bugs.interfaces.bugwatch import IBugWatchSet437 >>> from lp.bugs.interfaces.bugwatch import IBugWatchSet
438 >>> from lp.bugs.model.bugtracker import BugTracker
439 >>> from lp.registry.interfaces.person import IPersonSet439 >>> from lp.registry.interfaces.person import IPersonSet
440440
441 >>> sample_person = getUtility(IPersonSet).getByEmail(441 >>> sample_person = getUtility(IPersonSet).getByEmail(
442442
=== modified file 'lib/lp/bugs/doc/hasbugs.txt'
--- lib/lp/bugs/doc/hasbugs.txt 2010-10-10 15:39:28 +0000
+++ lib/lp/bugs/doc/hasbugs.txt 2010-10-21 19:08:55 +0000
@@ -5,8 +5,8 @@
5between the object and some of the bug tasks connected to it, and allows5between the object and some of the bug tasks connected to it, and allows
6searching through the list of bugs.6searching through the list of bugs.
77
8 >>> from zope.component import getUtility
8 >>> from canonical.launchpad.webapp.testing import verifyObject9 >>> from canonical.launchpad.webapp.testing import verifyObject
9 >>> from zope.component import getUtility
10 >>> from lp.bugs.interfaces.bugtarget import IHasBugs10 >>> from lp.bugs.interfaces.bugtarget import IHasBugs
11 >>> from lp.registry.interfaces.distribution import IDistributionSet11 >>> from lp.registry.interfaces.distribution import IDistributionSet
12 >>> distroset = getUtility(IDistributionSet)12 >>> distroset = getUtility(IDistributionSet)
@@ -30,8 +30,11 @@
3030
31 >>> login("foo.bar@canonical.com")31 >>> login("foo.bar@canonical.com")
3232
33 >>> from canonical.launchpad.interfaces import (33 >>> from lp.bugs.interfaces.bugtask import (
34 ... BugTaskImportance, BugTaskStatus, IBugTaskSet)34 ... BugTaskImportance,
35 ... BugTaskStatus,
36 ... IBugTaskSet,
37 ... )
3538
36 >>> bug_one_in_debian_firefox = getUtility(IBugTaskSet).get(4)39 >>> bug_one_in_debian_firefox = getUtility(IBugTaskSet).get(4)
37 >>> bug_two_in_debian_firefox = getUtility(IBugTaskSet).get(5)40 >>> bug_two_in_debian_firefox = getUtility(IBugTaskSet).get(5)
3841
=== modified file 'lib/lp/bugs/doc/initial-bug-contacts.txt'
--- lib/lp/bugs/doc/initial-bug-contacts.txt 2010-10-14 18:42:19 +0000
+++ lib/lp/bugs/doc/initial-bug-contacts.txt 2010-10-21 19:08:55 +0000
@@ -388,9 +388,9 @@
388The list of teams that a user may add to a package as a bug supervisor will388The list of teams that a user may add to a package as a bug supervisor will
389only contain those teams of which the user is an administrator.389only contain those teams of which the user is an administrator.
390390
391 >>> from lp.registry.interfaces.distribution import IDistributionSet
392 >>> from zope.component import getMultiAdapter391 >>> from zope.component import getMultiAdapter
393 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest392 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
393 >>> from lp.registry.interfaces.distribution import IDistributionSet
394394
395 >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu')395 >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
396 >>> package = ubuntu.getSourcePackage('mozilla-firefox')396 >>> package = ubuntu.getSourcePackage('mozilla-firefox')
397397
=== modified file 'lib/lp/bugs/doc/malone-karma.txt'
--- lib/lp/bugs/doc/malone-karma.txt 2010-10-10 15:39:28 +0000
+++ lib/lp/bugs/doc/malone-karma.txt 2010-10-21 19:08:55 +0000
@@ -2,8 +2,10 @@
2import some stuff and define a function to help us make the2import some stuff and define a function to help us make the
3documentation cleaner:3documentation cleaner:
44
5 >>> from canonical.launchpad.interfaces import (5 >>> from lp.bugs.interfaces.bug import IBugSet
6 ... IBugSet, IDistributionSet, IKarmaActionSet, IPersonSet)6 >>> from lp.registry.interfaces.distribution import IDistributionSet
7 >>> from lp.registry.interfaces.karma import IKarmaActionSet
8 >>> from lp.registry.interfaces.person import IPersonSet
7 >>> foo_bar = getUtility(IPersonSet).getByEmail('foo.bar@canonical.com')9 >>> foo_bar = getUtility(IPersonSet).getByEmail('foo.bar@canonical.com')
810
9Setup an event listener to help ensure karma is assigned when it should.11Setup an event listener to help ensure karma is assigned when it should.
@@ -70,8 +72,10 @@
7072
71Mark a bug task as fixed:73Mark a bug task as fixed:
7274
73 >>> from canonical.launchpad.interfaces import (75 >>> from lp.bugs.interfaces.bugtask import (
74 ... BugTaskStatus, IDistroBugTask)76 ... BugTaskStatus,
77 ... IDistroBugTask,
78 ... )
75 >>> bugtask = bug.bugtasks[0]79 >>> bugtask = bug.bugtasks[0]
76 >>> old_bugtask = Snapshot(bugtask, providing=IDistroBugTask)80 >>> old_bugtask = Snapshot(bugtask, providing=IDistroBugTask)
77 >>> bugtask.transitionToStatus(81 >>> bugtask.transitionToStatus(
7882
=== modified file 'lib/lp/bugs/doc/malone-xmlrpc.txt'
--- lib/lp/bugs/doc/malone-xmlrpc.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/doc/malone-xmlrpc.txt 2010-10-21 19:08:55 +0000
@@ -46,8 +46,8 @@
46IObjectCreatedEvent is being published when a bug is reported through46IObjectCreatedEvent is being published when a bug is reported through
47the XML-RPC interface.47the XML-RPC interface.
4848
49 >>> from canonical.launchpad.ftests.event import TestEventListener
49 >>> from lazr.lifecycle.interfaces import IObjectCreatedEvent50 >>> from lazr.lifecycle.interfaces import IObjectCreatedEvent
50 >>> from canonical.launchpad.ftests.event import TestEventListener
51 >>> from lp.bugs.interfaces.bug import IBug51 >>> from lp.bugs.interfaces.bug import IBug
5252
53 >>> def on_created_event(obj, event):53 >>> def on_created_event(obj, event):
@@ -233,8 +233,10 @@
233for authentication with external bug trackers.233for authentication with external bug trackers.
234234
235 >>> from zope.component import getUtility235 >>> from zope.component import getUtility
236 >>> from canonical.launchpad.interfaces import (236 >>> from canonical.launchpad.interfaces.launchpad import (
237 ... IPrivateMaloneApplication, IPrivateApplication)237 ... IPrivateApplication,
238 ... IPrivateMaloneApplication,
239 ... )
238 >>> from canonical.launchpad.webapp.testing import verifyObject240 >>> from canonical.launchpad.webapp.testing import verifyObject
239241
240 >>> private_root = getUtility(IPrivateApplication)242 >>> private_root = getUtility(IPrivateApplication)
@@ -245,9 +247,9 @@
245The API provides a single method, newBugTrackerToken(), which returns247The API provides a single method, newBugTrackerToken(), which returns
246the ID of the new LoginToken.248the ID of the new LoginToken.
247249
250 >>> from canonical.launchpad.interfaces.logintoken import ILoginTokenSet
248 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest251 >>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
249 >>> from canonical.launchpad.interfaces import (252 >>> from lp.bugs.interfaces.externalbugtracker import IExternalBugTrackerTokenAPI
250 ... IExternalBugTrackerTokenAPI, ILoginTokenSet)
251 >>> from lp.bugs.xmlrpc.bug import (253 >>> from lp.bugs.xmlrpc.bug import (
252 ... ExternalBugTrackerTokenAPI)254 ... ExternalBugTrackerTokenAPI)
253255
254256
=== modified file 'lib/lp/bugs/doc/official-bug-tags.txt'
--- lib/lp/bugs/doc/official-bug-tags.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/doc/official-bug-tags.txt 2010-10-21 19:08:55 +0000
@@ -3,8 +3,8 @@
3Distributions and products can define official bug tags.3Distributions and products can define official bug tags.
44
5 >>> from zope.component import getUtility5 >>> from zope.component import getUtility
6 >>> from canonical.launchpad.interfaces import (6 >>> from lp.registry.interfaces.distribution import IDistributionSet
7 ... IDistributionSet, IProductSet)7 >>> from lp.registry.interfaces.product import IProductSet
8 >>> from canonical.launchpad.webapp.interfaces import (8 >>> from canonical.launchpad.webapp.interfaces import (
9 ... IStoreSelector, MAIN_STORE, DEFAULT_FLAVOR)9 ... IStoreSelector, MAIN_STORE, DEFAULT_FLAVOR)
10 >>> from lp.bugs.model.bugtarget import OfficialBugTag10 >>> from lp.bugs.model.bugtarget import OfficialBugTag
@@ -169,7 +169,7 @@
169 >>> ubuntu.official_bug_tags = [u'foo', u'bar']169 >>> ubuntu.official_bug_tags = [u'foo', u'bar']
170 Traceback (most recent call last):170 Traceback (most recent call last):
171 ...171 ...
172 Unauthorized: (<Distribution 'Ubuntu' (ubuntu)>, 'official_bug_tags', 'launchpad.Edit')172 Unauthorized: (<Distribution 'Ubuntu' (ubuntu)>, 'official_bug_tags', 'launchpad.BugSupervisor')
173173
174The same is available for products.174The same is available for products.
175175
176176
=== modified file 'lib/lp/bugs/doc/security-teams.txt'
--- lib/lp/bugs/doc/security-teams.txt 2010-10-11 16:17:45 +0000
+++ lib/lp/bugs/doc/security-teams.txt 2010-10-21 19:08:55 +0000
@@ -5,10 +5,10 @@
5a "security contact" on a Distribution or a Product.5a "security contact" on a Distribution or a Product.
66
7 >>> from zope.component import getUtility7 >>> from zope.component import getUtility
8 >>> from lp.bugs.interfaces.securitycontact import IHasSecurityContact
8 >>> from lp.registry.interfaces.distribution import IDistributionSet9 >>> from lp.registry.interfaces.distribution import IDistributionSet
9 >>> from lp.registry.interfaces.person import IPersonSet10 >>> from lp.registry.interfaces.person import IPersonSet
10 >>> from lp.registry.interfaces.product import IProductSet11 >>> from lp.registry.interfaces.product import IProductSet
11 >>> from lp.bugs.interfaces.securitycontact import IHasSecurityContact
1212
13 >>> personset = getUtility(IPersonSet)13 >>> personset = getUtility(IPersonSet)
14 >>> productset = getUtility(IProductSet)14 >>> productset = getUtility(IProductSet)
@@ -280,10 +280,10 @@
280When a bug becomes security-related, the security contacts for the pillars it280When a bug becomes security-related, the security contacts for the pillars it
281affects are subscribed to it.281affects are subscribed to it.
282282
283 >>> from zope.event import notify
284 >>> from lazr.lifecycle.event import ObjectModifiedEvent
285 >>> from lazr.lifecycle.snapshot import Snapshot
283 >>> from lp.bugs.interfaces.bug import IBug286 >>> from lp.bugs.interfaces.bug import IBug
284 >>> from zope.event import notify
285 >>> from lazr.lifecycle.event import ObjectModifiedEvent
286 >>> from lazr.lifecycle.snapshot import Snapshot
287287
288 >>> product = factory.makeProduct()288 >>> product = factory.makeProduct()
289 >>> product.security_contact = factory.makePerson(289 >>> product.security_contact = factory.makePerson(
290290
=== modified file 'lib/lp/bugs/doc/sourceforge-remote-products.txt'
--- lib/lp/bugs/doc/sourceforge-remote-products.txt 2010-10-04 19:50:45 +0000
+++ lib/lp/bugs/doc/sourceforge-remote-products.txt 2010-10-21 19:08:55 +0000
@@ -21,8 +21,8 @@
21If we add a Product and link it to a SourceForge project,21If we add a Product and link it to a SourceForge project,
22getSFLinkedProductsWithNoneRemoteProduct() will return it.22getSFLinkedProductsWithNoneRemoteProduct() will return it.
2323
24 >>> from lp.testing.factory import LaunchpadObjectFactory
24 >>> from transaction import commit25 >>> from transaction import commit
25 >>> from lp.testing.factory import LaunchpadObjectFactory
26 >>> factory = LaunchpadObjectFactory()26 >>> factory = LaunchpadObjectFactory()
2727
28 >>> product_1 = factory.makeProduct(name='my-first-product')28 >>> product_1 = factory.makeProduct(name='my-first-product')
2929
=== modified file 'lib/lp/bugs/stories/bug-privacy/40-unsubscribe-from-private-bug.txt'
--- lib/lp/bugs/stories/bug-privacy/40-unsubscribe-from-private-bug.txt 2010-10-04 20:46:55 +0000
+++ lib/lp/bugs/stories/bug-privacy/40-unsubscribe-from-private-bug.txt 2010-10-21 19:08:55 +0000
@@ -1,10 +1,11 @@
1First, some setup. Find out what the latest [private] bug reported on1First, some setup. Find out what the latest [private] bug reported on
2Ubuntu evolution is, so we can avoid hardcoding its ID here:2Ubuntu evolution is, so we can avoid hardcoding its ID here:
33
4 >>> from canonical.launchpad.interfaces import (
5 ... IDistributionSet, BugTaskSearchParams, ILaunchBag,
6 ... ISourcePackageNameSet)
7 >>> from zope.component import getUtility4 >>> from zope.component import getUtility
5 >>> from canonical.launchpad.webapp.interfaces import ILaunchBag
6 >>> from lp.bugs.interfaces.bugtask import BugTaskSearchParams
7 >>> from lp.registry.interfaces.distribution import IDistributionSet
8 >>> from lp.registry.interfaces.sourcepackagename import ISourcePackageNameSet
8 >>> from canonical.launchpad.ftests import login, logout9 >>> from canonical.launchpad.ftests import login, logout
910
10 >>> login("foo.bar@canonical.com")11 >>> login("foo.bar@canonical.com")
1112
=== modified file 'lib/lp/bugs/stories/bug-tags/xx-official-bug-tags.txt'
--- lib/lp/bugs/stories/bug-tags/xx-official-bug-tags.txt 2010-10-15 14:26:57 +0000
+++ lib/lp/bugs/stories/bug-tags/xx-official-bug-tags.txt 2010-10-21 19:08:55 +0000
@@ -71,6 +71,17 @@
71 >>> print bug_super_browser.url71 >>> print bug_super_browser.url
72 http://bugs.launchpad.dev/youbuntu/+manage-official-tags72 http://bugs.launchpad.dev/youbuntu/+manage-official-tags
7373
74The bug supervisor can also set the tags for the product.
75
76 >>> bug_super_browser.getControl('Official Bug Tags').value = 'foo bar'
77 >>> bug_super_browser.getControl('Save').click()
78 >>> print bug_super_browser.url
79 http://bugs.launchpad.dev/youbuntu
80 >>> bug_super_browser.open(
81 ... 'http://bugs.launchpad.dev/youbuntu/+manage-official-tags')
82 >>> print bug_super_browser.getControl('Official Bug Tags').value
83 bar foo
84
74== Official Tags on Bug Pages ==85== Official Tags on Bug Pages ==
7586
76Official tags are displayed using a different style from unofficial ones.87Official tags are displayed using a different style from unofficial ones.
@@ -101,8 +112,8 @@
101112
102The tags portlet displays a mix of official and unofficial tags.113The tags portlet displays a mix of official and unofficial tags.
103114
115 >>> from zope.component import getUtility
104 >>> from lp.registry.interfaces.product import IProductSet116 >>> from lp.registry.interfaces.product import IProductSet
105 >>> from zope.component import getUtility
106 >>> login('foo.bar@canonical.com')117 >>> login('foo.bar@canonical.com')
107 >>> firesocks = factory.makeProduct(name='firesocks')118 >>> firesocks = factory.makeProduct(name='firesocks')
108 >>> firesocks_bugs_url = canonical_url(firesocks, rootsite='bugs')119 >>> firesocks_bugs_url = canonical_url(firesocks, rootsite='bugs')
109120
=== modified file 'lib/lp/bugs/stories/bugattachments/xx-attachments-to-bug-report.txt'
--- lib/lp/bugs/stories/bugattachments/xx-attachments-to-bug-report.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/stories/bugattachments/xx-attachments-to-bug-report.txt 2010-10-21 19:08:55 +0000
@@ -22,8 +22,8 @@
22 >>> import StringIO22 >>> import StringIO
23 >>> from zope.component import getUtility23 >>> from zope.component import getUtility
24 >>> from canonical.launchpad.ftests import login, logout, syncUpdate24 >>> from canonical.launchpad.ftests import login, logout, syncUpdate
25 >>> from canonical.launchpad.webapp.interfaces import ILaunchBag
25 >>> from lp.bugs.interfaces.bug import IBugSet26 >>> from lp.bugs.interfaces.bug import IBugSet
26 >>> from canonical.launchpad.webapp.interfaces import ILaunchBag
27 >>> login("test@canonical.com")27 >>> login("test@canonical.com")
28 >>> bug_11 = getUtility(IBugSet).get(11)28 >>> bug_11 = getUtility(IBugSet).get(11)
29 >>> launchbag = getUtility(ILaunchBag)29 >>> launchbag = getUtility(ILaunchBag)
3030
=== modified file 'lib/lp/bugs/stories/bugs/xx-bug-nomination-table-row.txt'
--- lib/lp/bugs/stories/bugs/xx-bug-nomination-table-row.txt 2010-10-10 15:39:28 +0000
+++ lib/lp/bugs/stories/bugs/xx-bug-nomination-table-row.txt 2010-10-21 19:08:55 +0000
@@ -12,9 +12,9 @@
12 >>> from zope.component import getUtility12 >>> from zope.component import getUtility
1313
14 >>> from canonical.launchpad.ftests import login, logout14 >>> from canonical.launchpad.ftests import login, logout
15 >>> from canonical.launchpad.webapp.authorization import check_permission
15 >>> from lp.bugs.interfaces.bug import IBugSet16 >>> from lp.bugs.interfaces.bug import IBugSet
16 >>> from lp.registry.interfaces.distribution import IDistributionSet17 >>> from lp.registry.interfaces.distribution import IDistributionSet
17 >>> from canonical.launchpad.webapp.authorization import check_permission
1818
19 >>> login("no-priv@canonical.com")19 >>> login("no-priv@canonical.com")
2020
2121
=== modified file 'lib/lp/bugs/stories/bugs/xx-bugs-advanced-search-upstream-status.txt'
--- lib/lp/bugs/stories/bugs/xx-bugs-advanced-search-upstream-status.txt 2010-10-03 15:30:06 +0000
+++ lib/lp/bugs/stories/bugs/xx-bugs-advanced-search-upstream-status.txt 2010-10-21 19:08:55 +0000
@@ -39,8 +39,9 @@
3939
40 >>> from zope.component import getUtility40 >>> from zope.component import getUtility
41 >>> from canonical.launchpad.ftests import login, logout, syncUpdate41 >>> from canonical.launchpad.ftests import login, logout, syncUpdate
42 >>> from canonical.launchpad.interfaces import (42 >>> from canonical.launchpad.webapp.interfaces import ILaunchBag
43 ... BugTaskStatus, IBugSet, ILaunchBag)43 >>> from lp.bugs.interfaces.bug import IBugSet
44 >>> from lp.bugs.interfaces.bugtask import BugTaskStatus
4445
45 >>> login("foo.bar@canonical.com")46 >>> login("foo.bar@canonical.com")
4647
4748
=== modified file 'lib/lp/bugs/stories/bugs/xx-front-page-bug-lists.txt'
--- lib/lp/bugs/stories/bugs/xx-front-page-bug-lists.txt 2010-10-03 15:30:06 +0000
+++ lib/lp/bugs/stories/bugs/xx-front-page-bug-lists.txt 2010-10-21 19:08:55 +0000
@@ -9,8 +9,11 @@
9 >>> from zope.component import getUtility9 >>> from zope.component import getUtility
10 >>> from canonical.launchpad.ftests import login, logout10 >>> from canonical.launchpad.ftests import login, logout
11 >>> import transaction11 >>> import transaction
12 >>> from canonical.launchpad.interfaces import (12 >>> from canonical.launchpad.webapp.interfaces import ILaunchBag
13 ... BugTaskImportance, BugTaskStatus, ILaunchBag)13 >>> from lp.bugs.interfaces.bugtask import (
14 ... BugTaskImportance,
15 ... BugTaskStatus,
16 ... )
14 >>> login('foo.bar@canonical.com')17 >>> login('foo.bar@canonical.com')
15 >>> bigfixer = factory.makeProduct(name='bigfixer')18 >>> bigfixer = factory.makeProduct(name='bigfixer')
16 >>> for bug_x in range(1, 11):19 >>> for bug_x in range(1, 11):
1720
=== modified file 'lib/lp/bugs/stories/bugs/xx-incomplete-bugs.txt'
--- lib/lp/bugs/stories/bugs/xx-incomplete-bugs.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/stories/bugs/xx-incomplete-bugs.txt 2010-10-21 19:08:55 +0000
@@ -104,9 +104,9 @@
104detailing the amount of time that has passed since the bug's expiration104detailing the amount of time that has passed since the bug's expiration
105date. We alter the date_last_updated field of bug 11 to demonstrate this.105date. We alter the date_last_updated field of bug 11 to demonstrate this.
106106
107 >>> from datetime import timedelta
108 >>> from zope.component import getUtility107 >>> from zope.component import getUtility
109 >>> from canonical.database.sqlbase import flush_database_updates108 >>> from canonical.database.sqlbase import flush_database_updates
109 >>> from datetime import timedelta
110 >>> from canonical.launchpad.ftests import login, logout110 >>> from canonical.launchpad.ftests import login, logout
111 >>> from lp.bugs.interfaces.bug import IBugSet111 >>> from lp.bugs.interfaces.bug import IBugSet
112 >>> login('test@canonical.com')112 >>> login('test@canonical.com')
113113
=== modified file 'lib/lp/bugs/stories/bugs/xx-portlets-bug-milestones.txt'
--- lib/lp/bugs/stories/bugs/xx-portlets-bug-milestones.txt 2010-10-08 12:06:55 +0000
+++ lib/lp/bugs/stories/bugs/xx-portlets-bug-milestones.txt 2010-10-21 19:08:55 +0000
@@ -55,8 +55,8 @@
55 >>> print ff_bugtask.bug.id55 >>> print ff_bugtask.bug.id
56 456 4
5757
58 >>> from lp.registry.interfaces.milestone import IMilestoneSet
58 >>> from lp.registry.interfaces.product import IProductSet59 >>> from lp.registry.interfaces.product import IProductSet
59 >>> from lp.registry.interfaces.milestone import IMilestoneSet
60 >>> firefox = getUtility(IProductSet).getByName('firefox')60 >>> firefox = getUtility(IProductSet).getByName('firefox')
61 >>> ff_milestone = getUtility(IMilestoneSet).getByNameAndProduct(61 >>> ff_milestone = getUtility(IMilestoneSet).getByNameAndProduct(
62 ... "1.0", firefox)62 ... "1.0", firefox)
6363
=== modified file 'lib/lp/bugs/stories/bugs/xx-remote-bug-comments.txt'
--- lib/lp/bugs/stories/bugs/xx-remote-bug-comments.txt 2010-10-14 18:42:19 +0000
+++ lib/lp/bugs/stories/bugs/xx-remote-bug-comments.txt 2010-10-21 19:08:55 +0000
@@ -72,9 +72,9 @@
72the 'awaiting synchronization' mark goes away.72the 'awaiting synchronization' mark goes away.
7373
74 >>> from zope.component import getUtility74 >>> from zope.component import getUtility
75 >>> from canonical.database.sqlbase import flush_database_updates
75 >>> from lp.bugs.interfaces.bug import IBugSet76 >>> from lp.bugs.interfaces.bug import IBugSet
76 >>> from lp.bugs.interfaces.bugmessage import IBugMessageSet77 >>> from lp.bugs.interfaces.bugmessage import IBugMessageSet
77 >>> from canonical.database.sqlbase import flush_database_updates
78 >>> login('foo.bar@canonical.com')78 >>> login('foo.bar@canonical.com')
79 >>> bug_15 = getUtility(IBugSet).get(15)79 >>> bug_15 = getUtility(IBugSet).get(15)
80 >>> message = bug_15.messages[-1]80 >>> message = bug_15.messages[-1]
8181
=== modified file 'lib/lp/bugs/stories/bugtask-management/xx-bug-importance-change.txt'
--- lib/lp/bugs/stories/bugtask-management/xx-bug-importance-change.txt 2010-10-03 15:30:06 +0000
+++ lib/lp/bugs/stories/bugtask-management/xx-bug-importance-change.txt 2010-10-21 19:08:55 +0000
@@ -23,8 +23,9 @@
23 >>> from zope.component import getUtility23 >>> from zope.component import getUtility
2424
25 >>> from canonical.launchpad.ftests import ANONYMOUS, login, logout25 >>> from canonical.launchpad.ftests import ANONYMOUS, login, logout
26 >>> from canonical.launchpad.interfaces import (26 >>> from lp.registry.interfaces.distribution import IDistributionSet
27 ... IPersonSet, IProductSet, IDistributionSet)27 >>> from lp.registry.interfaces.person import IPersonSet
28 >>> from lp.registry.interfaces.product import IProductSet
2829
29 >>> login("foo.bar@canonical.com")30 >>> login("foo.bar@canonical.com")
3031
3132
=== modified file 'lib/lp/bugs/stories/bugtask-searches/xx-listing-basics.txt'
--- lib/lp/bugs/stories/bugtask-searches/xx-listing-basics.txt 2010-10-06 18:27:57 +0000
+++ lib/lp/bugs/stories/bugtask-searches/xx-listing-basics.txt 2010-10-21 19:08:55 +0000
@@ -233,10 +233,11 @@
233Patches also appear as badges in bug listings.233Patches also appear as badges in bug listings.
234234
235 >>> from canonical.launchpad.ftests import login, logout235 >>> from canonical.launchpad.ftests import login, logout
236 >>> from canonical.launchpad.interfaces import (
237 ... IBugSet, IMessageSet, IPersonSet)
238 >>> from zope.component import getUtility236 >>> from zope.component import getUtility
239 >>> from StringIO import StringIO237 >>> from StringIO import StringIO
238 >>> from canonical.launchpad.interfaces.message import IMessageSet
239 >>> from lp.bugs.interfaces.bug import IBugSet
240 >>> from lp.registry.interfaces.person import IPersonSet
240 >>> import transaction241 >>> import transaction
241 >>> login("foo.bar@canonical.com")242 >>> login("foo.bar@canonical.com")
242 >>> foobar = getUtility(IPersonSet).getByName("name16")243 >>> foobar = getUtility(IPersonSet).getByName("name16")
243244
=== modified file 'lib/lp/bugs/stories/bugtask-searches/xx-searching-by-tags.txt'
--- lib/lp/bugs/stories/bugtask-searches/xx-searching-by-tags.txt 2010-10-03 15:30:06 +0000
+++ lib/lp/bugs/stories/bugtask-searches/xx-searching-by-tags.txt 2010-10-21 19:08:55 +0000
@@ -7,9 +7,10 @@
77
8First, we create some bugs.8First, we create some bugs.
99
10 >>> from canonical.launchpad.interfaces import (
11 ... IPersonSet, IProductSet, CreateBugParams)
12 >>> from zope.component import getUtility10 >>> from zope.component import getUtility
11 >>> from lp.bugs.interfaces.bug import CreateBugParams
12 >>> from lp.registry.interfaces.person import IPersonSet
13 >>> from lp.registry.interfaces.product import IProductSet
13 >>> from canonical.launchpad.ftests import login, logout14 >>> from canonical.launchpad.ftests import login, logout
1415
15 >>> login("no-priv@canonical.com")16 >>> login("no-priv@canonical.com")
1617
=== modified file 'lib/lp/bugs/stories/bugwatches/xx-edit-bugwatch.txt'
--- lib/lp/bugs/stories/bugwatches/xx-edit-bugwatch.txt 2010-08-26 14:57:11 +0000
+++ lib/lp/bugs/stories/bugwatches/xx-edit-bugwatch.txt 2010-10-21 19:08:55 +0000
@@ -60,9 +60,9 @@
60If we change the next_check date of the watch its will be shown in the60If we change the next_check date of the watch its will be shown in the
61Next check column.61Next check column.
6262
63 >>> from zope.component import getUtility
63 >>> from datetime import datetime64 >>> from datetime import datetime
64 >>> from pytz import utc65 >>> from pytz import utc
65 >>> from zope.component import getUtility
6666
67 >>> from canonical.launchpad.ftests import login, logout67 >>> from canonical.launchpad.ftests import login, logout
68 >>> from lp.bugs.interfaces.bugwatch import IBugWatchSet68 >>> from lp.bugs.interfaces.bugwatch import IBugWatchSet
6969
=== modified file 'lib/lp/bugs/stories/cve/cve-linking.txt'
--- lib/lp/bugs/stories/cve/cve-linking.txt 2010-10-11 16:17:45 +0000
+++ lib/lp/bugs/stories/cve/cve-linking.txt 2010-10-21 19:08:55 +0000
@@ -109,9 +109,9 @@
109 # This should use a private bug in our sample data.109 # This should use a private bug in our sample data.
110 >>> from zope.component import getUtility110 >>> from zope.component import getUtility
111 >>> from canonical.launchpad.ftests import login, logout111 >>> from canonical.launchpad.ftests import login, logout
112 >>> from canonical.database.sqlbase import flush_database_updates
112 >>> from canonical.launchpad.webapp.interfaces import ILaunchBag113 >>> from canonical.launchpad.webapp.interfaces import ILaunchBag
113 >>> from lp.bugs.interfaces.bug import IBugSet114 >>> from lp.bugs.interfaces.bug import IBugSet
114 >>> from canonical.database.sqlbase import flush_database_updates
115 >>> login('foo.bar@canonical.com')115 >>> login('foo.bar@canonical.com')
116 >>> private_bug = getUtility(IBugSet).get(6)116 >>> private_bug = getUtility(IBugSet).get(6)
117 >>> current_user = getUtility(ILaunchBag).user117 >>> current_user = getUtility(ILaunchBag).user
118118
=== modified file 'lib/lp/bugs/stories/feeds/xx-bug-atom.txt'
--- lib/lp/bugs/stories/feeds/xx-bug-atom.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/stories/feeds/xx-bug-atom.txt 2010-10-21 19:08:55 +0000
@@ -338,8 +338,8 @@
338This feed gets the latest bugs for a whole team.338This feed gets the latest bugs for a whole team.
339First, make a team responsible for some bugs.339First, make a team responsible for some bugs.
340340
341 >>> from zope.component import getUtility
341 >>> from lp.registry.interfaces.person import IPersonSet342 >>> from lp.registry.interfaces.person import IPersonSet
342 >>> from zope.component import getUtility
343 >>> one_mem_browser = setupBrowser(343 >>> one_mem_browser = setupBrowser(
344 ... auth='Basic one-membership@test.com:test')344 ... auth='Basic one-membership@test.com:test')
345 >>> personset = getUtility(IPersonSet)345 >>> personset = getUtility(IPersonSet)
346346
=== modified file 'lib/lp/bugs/stories/feeds/xx-bug-html.txt'
--- lib/lp/bugs/stories/feeds/xx-bug-html.txt 2009-10-13 19:51:20 +0000
+++ lib/lp/bugs/stories/feeds/xx-bug-html.txt 2010-10-21 19:08:55 +0000
@@ -4,8 +4,10 @@
4The content of an HTML feed is very similar to an Atom feed, but is formatted4The content of an HTML feed is very similar to an Atom feed, but is formatted
5as HTML instead of Atom.5as HTML instead of Atom.
66
7 >>> from BeautifulSoup import BeautifulSoup7 >>> from BeautifulSoup import (
8 >>> from BeautifulSoup import SoupStrainer8 ... BeautifulSoup,
9 ... SoupStrainer,
10 ... )
911
10Define a helper function for parsing the entries:12Define a helper function for parsing the entries:
1113
1214
=== modified file 'lib/lp/bugs/stories/structural-subscriptions/xx-bug-subscriptions.txt'
--- lib/lp/bugs/stories/structural-subscriptions/xx-bug-subscriptions.txt 2010-10-06 18:53:53 +0000
+++ lib/lp/bugs/stories/structural-subscriptions/xx-bug-subscriptions.txt 2010-10-21 19:08:55 +0000
@@ -74,8 +74,8 @@
74Firstly, we appoint Sample Person as the driver for the distribution.74Firstly, we appoint Sample Person as the driver for the distribution.
7575
76 >>> from canonical.database.sqlbase import flush_database_updates76 >>> from canonical.database.sqlbase import flush_database_updates
77 >>> from canonical.launchpad.interfaces import (77 >>> from lp.registry.interfaces.distribution import IDistributionSet
78 ... IDistributionSet, IPersonSet)78 >>> from lp.registry.interfaces.person import IPersonSet
79 >>> from canonical.launchpad.ftests import login, logout79 >>> from canonical.launchpad.ftests import login, logout
80 >>> from zope.component import getUtility80 >>> from zope.component import getUtility
81 >>> login('foo.bar@canonical.com')81 >>> login('foo.bar@canonical.com')
8282
=== modified file 'lib/lp/bugs/stories/webservice/xx-bug.txt'
--- lib/lp/bugs/stories/webservice/xx-bug.txt 2010-09-20 19:23:08 +0000
+++ lib/lp/bugs/stories/webservice/xx-bug.txt 2010-10-21 19:08:55 +0000
@@ -116,8 +116,8 @@
116Activity is recorded and notifications are sent for newly created116Activity is recorded and notifications are sent for newly created
117bugs.117bugs.
118118
119 >>> from lp.bugs.interfaces.bug import IBugSet
119 >>> from lp.bugs.model.bugnotification import BugNotification120 >>> from lp.bugs.model.bugnotification import BugNotification
120 >>> from lp.bugs.interfaces.bug import IBugSet
121 >>> from canonical.launchpad.ftests import ANONYMOUS, login, logout121 >>> from canonical.launchpad.ftests import ANONYMOUS, login, logout
122 >>> from zope.component import getUtility122 >>> from zope.component import getUtility
123123
124124
=== modified file 'lib/lp/bugs/tests/buglinktarget.txt'
--- lib/lp/bugs/tests/buglinktarget.txt 2010-10-03 15:30:06 +0000
+++ lib/lp/bugs/tests/buglinktarget.txt 2010-10-21 19:08:55 +0000
@@ -16,8 +16,11 @@
16 # to a registered user.16 # to a registered user.
17 >>> login('no-priv@canonical.com')17 >>> login('no-priv@canonical.com')
18 >>> from zope.interface.verify import verifyObject18 >>> from zope.interface.verify import verifyObject
19 >>> from canonical.launchpad.interfaces import (19 >>> from lp.bugs.interfaces.bug import IBugSet
20 ... IBugLinkTarget, IBugLink, IBugSet)20 >>> from lp.bugs.interfaces.buglink import (
21 ... IBugLink,
22 ... IBugLinkTarget,
23 ... )
2124
22 >>> verifyObject(IBugLinkTarget, target)25 >>> verifyObject(IBugLinkTarget, target)
23 True26 True
2427
=== modified file 'lib/lp/bugs/tests/bugs-emailinterface.txt'
--- lib/lp/bugs/tests/bugs-emailinterface.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/tests/bugs-emailinterface.txt 2010-10-21 19:08:55 +0000
@@ -339,8 +339,7 @@
339will provide IWeaklyAuthenticatedPrincipal. Let's mark the current339will provide IWeaklyAuthenticatedPrincipal. Let's mark the current
340principal with that.340principal with that.
341341
342 >>> from canonical.launchpad.interfaces import (342 >>> from canonical.launchpad.interfaces.mail import IWeaklyAuthenticatedPrincipal
343 ... IWeaklyAuthenticatedPrincipal)
344 >>> from zope.interface import directlyProvides, directlyProvidedBy343 >>> from zope.interface import directlyProvides, directlyProvidedBy
345 >>> from zope.security.management import queryInteraction344 >>> from zope.security.management import queryInteraction
346 >>> participations = queryInteraction().participations345 >>> participations = queryInteraction().participations
@@ -1222,8 +1221,8 @@
1222bugs directly to series.1221bugs directly to series.
12231222
1224 >>> from canonical.config import config1223 >>> from canonical.config import config
1225 >>> from lp.registry.interfaces.distribution import IDistributionSet
1226 >>> from canonical.testing.layers import LaunchpadZopelessLayer1224 >>> from canonical.testing.layers import LaunchpadZopelessLayer
1225 >>> from lp.registry.interfaces.distribution import IDistributionSet
12271226
1228 # The script's default user doesn't have permission to change the driver.1227 # The script's default user doesn't have permission to change the driver.
1229 >>> commit()1228 >>> commit()
@@ -1648,8 +1647,8 @@
1648The user is a package bug supervisor1647The user is a package bug supervisor
1649~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1648~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16501649
1651 >>> from canonical.launchpad.interfaces import (1650 >>> from lp.registry.interfaces.distribution import IDistributionSet
1652 ... IDistributionSet, ISourcePackageNameSet)1651 >>> from lp.registry.interfaces.sourcepackagename import ISourcePackageNameSet
16531652
1654 >>> commit()1653 >>> commit()
1655 >>> LaunchpadZopelessLayer.switchDbUser('launchpad')1654 >>> LaunchpadZopelessLayer.switchDbUser('launchpad')
@@ -2880,8 +2879,8 @@
2880 >>> from lp.bugs.interfaces.bugtracker import BugTrackerType2879 >>> from lp.bugs.interfaces.bugtracker import BugTrackerType
2881 >>> from lp.bugs.tests.externalbugtracker import (2880 >>> from lp.bugs.tests.externalbugtracker import (
2882 ... new_bugtracker)2881 ... new_bugtracker)
2883 >>> from canonical.launchpad.interfaces import (2882 >>> from lp.bugs.interfaces.bugwatch import IBugWatchSet
2884 ... IBugWatchSet, IProductSet)2883 >>> from lp.registry.interfaces.product import IProductSet
28852884
2886 >>> firefox = getUtility(IProductSet).getByName('firefox')2885 >>> firefox = getUtility(IProductSet).getByName('firefox')
2887 >>> no_priv = getUtility(IPersonSet).getByName('no-priv')2886 >>> no_priv = getUtility(IPersonSet).getByName('no-priv')
28882887
=== modified file 'lib/lp/bugs/tests/bugtarget-questiontarget.txt'
--- lib/lp/bugs/tests/bugtarget-questiontarget.txt 2010-10-09 16:36:22 +0000
+++ lib/lp/bugs/tests/bugtarget-questiontarget.txt 2010-10-21 19:08:55 +0000
@@ -13,8 +13,8 @@
13Product, Distribution, ProductSeries, DistributionSeries,13Product, Distribution, ProductSeries, DistributionSeries,
14SourcePackage, or DistributionSourcePackages.14SourcePackage, or DistributionSourcePackages.
1515
16 >>> from canonical.launchpad.interfaces import (16 >>> from lp.answers.interfaces.questiontarget import IQuestionTarget
17 ... IBugTarget, IQuestionTarget)17 >>> from lp.bugs.interfaces.bugtarget import IBugTarget
1818
19 >>> login('foo.bar@canonical.com')19 >>> login('foo.bar@canonical.com')
20 >>> IBugTarget.providedBy(bugtarget)20 >>> IBugTarget.providedBy(bugtarget)
@@ -177,8 +177,9 @@
177 >>> big_bug = filebug(177 >>> big_bug = filebug(
178 ... bugtarget, "Print is borked", status=BugTaskStatus.NEW)178 ... bugtarget, "Print is borked", status=BugTaskStatus.NEW)
179179
180 >>> from canonical.launchpad.interfaces import (180 >>> from lp.bugs.interfaces.bugtask import IBugTaskSet
181 ... IBugTaskSet, IDistributionSet, ISourcePackageNameSet)181 >>> from lp.registry.interfaces.distribution import IDistributionSet
182 >>> from lp.registry.interfaces.sourcepackagename import ISourcePackageNameSet
182183
183 >>> ubuntu = getUtility(IDistributionSet)['ubuntu']184 >>> ubuntu = getUtility(IDistributionSet)['ubuntu']
184 >>> evo_ubuntu = getUtility(ISourcePackageNameSet)['evolution']185 >>> evo_ubuntu = getUtility(ISourcePackageNameSet)['evolution']
185186
=== modified file 'lib/lp/code/browser/tests/test_branchlisting.py'
--- lib/lp/code/browser/tests/test_branchlisting.py 2010-08-24 02:21:50 +0000
+++ lib/lp/code/browser/tests/test_branchlisting.py 2010-10-21 19:08:55 +0000
@@ -44,6 +44,7 @@
44from lp.testing import (44from lp.testing import (
45 BrowserTestCase,45 BrowserTestCase,
46 login_person,46 login_person,
47 normalize_whitespace,
47 person_logged_in,48 person_logged_in,
48 TestCase,49 TestCase,
49 TestCaseWithFactory,50 TestCaseWithFactory,
@@ -421,5 +422,37 @@
421 self.assertIs(None, branches)422 self.assertIs(None, branches)
422423
423424
425class TestProjectBranchListing(TestCaseWithFactory):
426
427 layer = DatabaseFunctionalLayer
428
429 def setUp(self):
430 super(TestProjectBranchListing, self).setUp()
431 self.project = self.factory.makeProject()
432 self.product = self.factory.makeProduct(project=self.project)
433
434 def test_no_branches_gets_message_not_listing(self):
435 # If there are no product branches on the project's products, then
436 # the view shows the no code hosting message instead of a listing.
437 browser = self.getUserBrowser(
438 canonical_url(self.project, rootsite='code'))
439 displayname = self.project.displayname
440 expected_text = normalize_whitespace(
441 ("Launchpad does not know where any of %s's "
442 "projects host their code." % displayname))
443 no_branch_div = find_tag_by_id(browser.contents, "no-branchtable")
444 text = normalize_whitespace(extract_text(no_branch_div))
445 self.assertEqual(expected_text, text)
446
447 def test_branches_get_listing(self):
448 # If a product has a branch, then the project view has a branch
449 # listing.
450 branch = self.factory.makeProductBranch(product=self.product)
451 browser = self.getUserBrowser(
452 canonical_url(self.project, rootsite='code'))
453 table = find_tag_by_id(browser.contents, "branchtable")
454 self.assertIsNot(None, table)
455
456
424def test_suite():457def test_suite():
425 return unittest.TestLoader().loadTestsFromName(__name__)458 return unittest.TestLoader().loadTestsFromName(__name__)
426459
=== modified file 'lib/lp/code/doc/branch-merge-proposal-notifications.txt'
--- lib/lp/code/doc/branch-merge-proposal-notifications.txt 2010-05-27 02:04:21 +0000
+++ lib/lp/code/doc/branch-merge-proposal-notifications.txt 2010-10-21 19:08:55 +0000
@@ -9,8 +9,8 @@
9When subscribers subscribe to branches, they can specify what level of9When subscribers subscribe to branches, they can specify what level of
10notification they would like to receive.10notification they would like to receive.
1111
12 >>> from zope.security.proxy import removeSecurityProxy
12 >>> from difflib import unified_diff13 >>> from difflib import unified_diff
13 >>> from zope.security.proxy import removeSecurityProxy
14 >>> from lp.code.enums import (14 >>> from lp.code.enums import (
15 ... BranchSubscriptionDiffSize, BranchSubscriptionNotificationLevel,15 ... BranchSubscriptionDiffSize, BranchSubscriptionNotificationLevel,
16 ... CodeReviewNotificationLevel)16 ... CodeReviewNotificationLevel)
@@ -101,7 +101,7 @@
101 ... displayname="Eric", email="eric@example.com")101 ... displayname="Eric", email="eric@example.com")
102 >>> # To avoid needing to access branches, pre-populate diffs.102 >>> # To avoid needing to access branches, pre-populate diffs.
103 >>> bmp = source_branch.addLandingTarget(103 >>> bmp = source_branch.addLandingTarget(
104 ... registrant, target_branch)104 ... registrant, target_branch, needs_review=True)
105 >>> removeSecurityProxy(bmp).preview_diff = preview_diff105 >>> removeSecurityProxy(bmp).preview_diff = preview_diff
106 >>> # Fake the update preview diff as done.106 >>> # Fake the update preview diff as done.
107 >>> bmp.next_preview_diff_job.start()107 >>> bmp.next_preview_diff_job.start()
@@ -156,7 +156,8 @@
156 >>> bmp.deleteProposal()156 >>> bmp.deleteProposal()
157 >>> bmp = source_branch.addLandingTarget(157 >>> bmp = source_branch.addLandingTarget(
158 ... registrant, target_branch,158 ... registrant, target_branch,
159 ... description=initial_comment, review_requests=reviewers)159 ... description=initial_comment, review_requests=reviewers,
160 ... needs_review=True)
160 >>> removeSecurityProxy(bmp).preview_diff = preview_diff161 >>> removeSecurityProxy(bmp).preview_diff = preview_diff
161 >>> # Fake the update preview diff as done.162 >>> # Fake the update preview diff as done.
162 >>> bmp.next_preview_diff_job.start()163 >>> bmp.next_preview_diff_job.start()
163164
=== modified file 'lib/lp/code/doc/branch-visibility.txt'
--- lib/lp/code/doc/branch-visibility.txt 2010-10-03 15:30:06 +0000
+++ lib/lp/code/doc/branch-visibility.txt 2010-10-21 19:08:55 +0000
@@ -60,8 +60,8 @@
60AccessBranch authorization class is used to authorize users for the60AccessBranch authorization class is used to authorize users for the
61combination of the launchpad.View permission and the IBranch interface.61combination of the launchpad.View permission and the IBranch interface.
6262
63 >>> from zope.component import getAdapter
63 >>> from canonical.launchpad.webapp.interfaces import IAuthorization64 >>> from canonical.launchpad.webapp.interfaces import IAuthorization
64 >>> from zope.component import getAdapter
65 >>> getAdapter(branch, IAuthorization, name='launchpad.View')65 >>> getAdapter(branch, IAuthorization, name='launchpad.View')
66 <canonical.launchpad.security.AccessBranch ...>66 <canonical.launchpad.security.AccessBranch ...>
6767
6868
=== modified file 'lib/lp/code/doc/codeimport-event.txt'
--- lib/lp/code/doc/codeimport-event.txt 2010-10-03 15:30:06 +0000
+++ lib/lp/code/doc/codeimport-event.txt 2010-10-21 19:08:55 +0000
@@ -19,8 +19,8 @@
19ICodeImportEventSet utility.19ICodeImportEventSet utility.
2020
21 >>> from zope.component import getUtility21 >>> from zope.component import getUtility
22 >>> from zope.security.proxy import removeSecurityProxy
22 >>> from canonical.launchpad.webapp.testing import verifyObject23 >>> from canonical.launchpad.webapp.testing import verifyObject
23 >>> from zope.security.proxy import removeSecurityProxy
24 >>> from lp.code.interfaces.codeimportevent import ICodeImportEventSet24 >>> from lp.code.interfaces.codeimportevent import ICodeImportEventSet
25 >>> event_set = getUtility(ICodeImportEventSet)25 >>> event_set = getUtility(ICodeImportEventSet)
26 >>> verifyObject(ICodeImportEventSet, removeSecurityProxy(event_set))26 >>> verifyObject(ICodeImportEventSet, removeSecurityProxy(event_set))
2727
=== modified file 'lib/lp/code/doc/codeimport-job.txt'
--- lib/lp/code/doc/codeimport-job.txt 2009-06-12 16:36:02 +0000
+++ lib/lp/code/doc/codeimport-job.txt 2010-10-21 19:08:55 +0000
@@ -49,8 +49,8 @@
4949
50There are two CodeImport objects of interest in the sample data.50There are two CodeImport objects of interest in the sample data.
5151
52 >>> from lp.code.interfaces.codeimport import ICodeImportSet
53 >>> from lp.code.interfaces.branchlookup import IBranchLookup52 >>> from lp.code.interfaces.branchlookup import IBranchLookup
53 >>> from lp.code.interfaces.codeimport import ICodeImportSet
54 >>> branch_lookup = getUtility(IBranchLookup)54 >>> branch_lookup = getUtility(IBranchLookup)
55 >>> code_import_set = getUtility(ICodeImportSet)55 >>> code_import_set = getUtility(ICodeImportSet)
5656
5757
=== modified file 'lib/lp/code/doc/codeimport.txt'
--- lib/lp/code/doc/codeimport.txt 2010-10-03 15:30:06 +0000
+++ lib/lp/code/doc/codeimport.txt 2010-10-21 19:08:55 +0000
@@ -23,9 +23,9 @@
2323
24 >>> from lp.code.interfaces.branchtarget import IBranchTarget24 >>> from lp.code.interfaces.branchtarget import IBranchTarget
25 >>> from lp.code.interfaces.codeimport import ICodeImport, ICodeImportSet25 >>> from lp.code.interfaces.codeimport import ICodeImport, ICodeImportSet
26 >>> from canonical.launchpad.webapp.testing import verifyObject
27 >>> from zope.component import getUtility26 >>> from zope.component import getUtility
28 >>> from zope.security.proxy import removeSecurityProxy27 >>> from zope.security.proxy import removeSecurityProxy
28 >>> from canonical.launchpad.webapp.testing import verifyObject
29 >>> code_import_set = getUtility(ICodeImportSet)29 >>> code_import_set = getUtility(ICodeImportSet)
30 >>> verifyObject(ICodeImportSet, removeSecurityProxy(code_import_set))30 >>> verifyObject(ICodeImportSet, removeSecurityProxy(code_import_set))
31 True31 True
@@ -341,8 +341,8 @@
341There is a separate default update interval for each version control system,341There is a separate default update interval for each version control system,
342set in the Launchpad configuration system.342set in the Launchpad configuration system.
343343
344 >>> from canonical.config import config
344 >>> from datetime import timedelta345 >>> from datetime import timedelta
345 >>> from canonical.config import config
346 >>> default_interval_cvs = timedelta(346 >>> default_interval_cvs = timedelta(
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to status/vote changes: