Merge ~cjwatson/launchpad:fix-wsgi-ppa-auth into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 4343a76a9a99e9435b6185c0a25905e57c79109c
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:fix-wsgi-ppa-auth
Merge into: launchpad:master
Diff against target: 29 lines (+10/-1)
1 file modified
lib/lp/registry/scripts/tests/test_closeaccount.py (+10/-1)
Reviewer Review Type Date Requested Status
Cristian Gonzalez (community) Approve
Review via email: mp+400279@code.launchpad.net

Commit message

Fix close-account tests for auth token changes

Description of the change

Archive.getAuthToken no longer returns tokens whose associated subscription has been cancelled, so adjust tests to account for that.

Broken by https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/399617.

To post a comment you must log in.
Revision history for this message
Cristian Gonzalez (cristiangsp) wrote :

Looks good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/lib/lp/registry/scripts/tests/test_closeaccount.py b/lib/lp/registry/scripts/tests/test_closeaccount.py
index f5afc52..c366539 100644
--- a/lib/lp/registry/scripts/tests/test_closeaccount.py
+++ b/lib/lp/registry/scripts/tests/test_closeaccount.py
@@ -59,6 +59,7 @@ from lp.soyuz.enums import (
59 PackagePublishingStatus,59 PackagePublishingStatus,
60 )60 )
61from lp.soyuz.model.archive import Archive61from lp.soyuz.model.archive import Archive
62from lp.soyuz.model.archiveauthtoken import ArchiveAuthToken
62from lp.soyuz.tests.test_publishing import SoyuzTestPublisher63from lp.soyuz.tests.test_publishing import SoyuzTestPublisher
63from lp.testing import (64from lp.testing import (
64 login_celebrity,65 login_celebrity,
@@ -408,7 +409,15 @@ class TestCloseAccount(TestCaseWithFactory):
408 self.assertEqual(now, subscription.date_cancelled)409 self.assertEqual(now, subscription.date_cancelled)
409 self.assertEqual(410 self.assertEqual(
410 ArchiveSubscriberStatus.CURRENT, other_subscription.status)411 ArchiveSubscriberStatus.CURRENT, other_subscription.status)
411 self.assertIsNotNone(ppa.getAuthToken(person))412 # The token remains, but is no longer valid since the subscription
413 # has been cancelled.
414 self.assertIsNotNone(
415 IStore(ArchiveAuthToken).find(
416 ArchiveAuthToken,
417 ArchiveAuthToken.archive == ppa,
418 ArchiveAuthToken.date_deactivated == None,
419 ArchiveAuthToken.person == person).one())
420 self.assertIsNone(ppa.getAuthToken(person))
412421
413 def test_handles_hardware_submissions(self):422 def test_handles_hardware_submissions(self):
414 # Launchpad used to support hardware submissions. This is in the423 # Launchpad used to support hardware submissions. This is in the

Subscribers

People subscribed via source and target branches

to status/vote changes: