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
1diff --git a/lib/lp/registry/scripts/tests/test_closeaccount.py b/lib/lp/registry/scripts/tests/test_closeaccount.py
2index f5afc52..c366539 100644
3--- a/lib/lp/registry/scripts/tests/test_closeaccount.py
4+++ b/lib/lp/registry/scripts/tests/test_closeaccount.py
5@@ -59,6 +59,7 @@ from lp.soyuz.enums import (
6 PackagePublishingStatus,
7 )
8 from lp.soyuz.model.archive import Archive
9+from lp.soyuz.model.archiveauthtoken import ArchiveAuthToken
10 from lp.soyuz.tests.test_publishing import SoyuzTestPublisher
11 from lp.testing import (
12 login_celebrity,
13@@ -408,7 +409,15 @@ class TestCloseAccount(TestCaseWithFactory):
14 self.assertEqual(now, subscription.date_cancelled)
15 self.assertEqual(
16 ArchiveSubscriberStatus.CURRENT, other_subscription.status)
17- self.assertIsNotNone(ppa.getAuthToken(person))
18+ # The token remains, but is no longer valid since the subscription
19+ # has been cancelled.
20+ self.assertIsNotNone(
21+ IStore(ArchiveAuthToken).find(
22+ ArchiveAuthToken,
23+ ArchiveAuthToken.archive == ppa,
24+ ArchiveAuthToken.date_deactivated == None,
25+ ArchiveAuthToken.person == person).one())
26+ self.assertIsNone(ppa.getAuthToken(person))
27
28 def test_handles_hardware_submissions(self):
29 # Launchpad used to support hardware submissions. This is in the

Subscribers

People subscribed via source and target branches

to status/vote changes: