324
324
[(u'udev', u'0.1-1'), (u'firefox', u'2.1')],
327
def test_intra_distro_perm_copying(self):
328
# If child.distribution equals parent.distribution, we also
329
# copy the archivepermissions.
330
parent, unused = self.setupParent()
331
uploader = self.factory.makePerson()
332
test1 = self.factory.makePackageset(
333
u'test1', u'test 1 packageset', parent.owner,
335
#test1 = getUtility(IPackagesetSet).new(
336
# u'test1', u'test 1 packageset', self.parent.owner,
337
# distroseries=self.parent)
338
test1.addSources('udev')
339
archive_permset = getUtility(IArchivePermissionSet)
340
archive_permset.newPackagesetUploader(
341
parent.main_archive, uploader, test1)
342
# Create child series in the same distribution.
343
child = self.factory.makeDistroSeries(
344
distribution=parent.distribution,
345
previous_series=parent)
346
self._fullInitialize([parent], child=child)
348
# The uploader can upload to the new distroseries.
349
self.assertTrue(archive_permset.isSourceUploadAllowed(
350
parent.main_archive, 'udev', uploader,
351
distroseries=parent))
352
self.assertTrue(archive_permset.isSourceUploadAllowed(
353
child.main_archive, 'udev', uploader,
327
356
def test_no_cross_distro_perm_copying(self):
328
357
# No cross-distro archivepermissions copying should happen.
329
358
self.parent, self.parent_das = self.setupParent()