1744
1744
two_hours_earlier = one_hour_earlier - one_hour_step
1745
1745
self.assertEqual(3, cprov_archive.getPublishedSources(
1746
1746
created_since_date=two_hours_earlier).count())
1749
class TestSyncSource(TestCaseWithFactory):
1751
layer = DatabaseFunctionalLayer
1753
def test_security_team_can_copy_to_primary(self):
1754
# A member of ubuntu-security can use syncSource on any package
1755
# in the Ubuntu primary archive, regardless of their normal
1756
# upload permissions.
1757
# This is until we can open syncSource up more widely and sort
1758
# out the permissions that everyone needs.
1759
with celebrity_logged_in('admin'):
1760
security_person = self.factory.makePerson()
1761
getUtility(ILaunchpadCelebrities).ubuntu_security.addMember(
1762
security_person, security_person)
1763
ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
1764
source = self.factory.makeSourcePackagePublishingHistory(
1765
archive=self.factory.makeArchive(purpose=ArchivePurpose.PPA),
1766
distroseries=ubuntu.currentseries)
1769
ubuntu.main_archive.getPublishedSources(
1770
name=source.source_package_name).count())
1771
with person_logged_in(security_person):
1772
ubuntu.main_archive.syncSource(
1773
source_name=source.source_package_name,
1774
version=source.source_package_version,
1775
from_archive=source.archive,
1776
to_pocket='Security')
1779
ubuntu.main_archive.getPublishedSources(
1780
name=source.source_package_name).count())