launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #26223
[Merge] ~cjwatson/launchpad:py3-insertFakeChangesFile into launchpad:master
Colin Watson has proposed merging ~cjwatson/launchpad:py3-insertFakeChangesFile into launchpad:master.
Commit message:
Correct uses of insertFakeChangesFile
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/397519
insertFakeChangesFile takes a LibraryFileContent ID, not a LibraryFileAlias ID. We seem to have somehow got away with passing entirely the wrong ID in tests so far, but it's an accident waiting to happen.
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-insertFakeChangesFile into launchpad:master.
diff --git a/lib/lp/archiveuploader/tests/__init__.py b/lib/lp/archiveuploader/tests/__init__.py
index c7300ea..ff5da4d 100644
--- a/lib/lp/archiveuploader/tests/__init__.py
+++ b/lib/lp/archiveuploader/tests/__init__.py
@@ -56,7 +56,7 @@ def insertFakeChangesFile(fileID, path=None):
def insertFakeChangesFileForAllPackageUploads():
"""Ensure all the PackageUpload records point to a valid changes file."""
- for id in set(pu.changesfile.id for pu in PackageUploadSet()):
+ for id in set(pu.changesfile.content.id for pu in PackageUploadSet()):
insertFakeChangesFile(id)
diff --git a/lib/lp/soyuz/doc/distroseriesqueue.txt b/lib/lp/soyuz/doc/distroseriesqueue.txt
index 476b636..b89956e 100644
--- a/lib/lp/soyuz/doc/distroseriesqueue.txt
+++ b/lib/lp/soyuz/doc/distroseriesqueue.txt
@@ -753,8 +753,8 @@ with fake changes files first so that emails can be generated.)
>>> from lp.archiveuploader.tests import insertFakeChangesFile
>>> items = breezy_autotest.getPackageUploads(PackageUploadStatus.NEW)
- >>> insertFakeChangesFile(items[1].changesfile.id)
- >>> insertFakeChangesFile(items[3].changesfile.id)
+ >>> insertFakeChangesFile(items[1].changesfile.content.id)
+ >>> insertFakeChangesFile(items[3].changesfile.content.id)
>>> items[1].acceptFromQueue()
Two emails are generated. We won't look what is inside them here, that is