コード例 #1
0
ファイル: test_utils_.py プロジェクト: kewisch/addons-server
    def test_unreviewed_files_plus_reviewed_file(self):
        # We upgrade unreviewed files up to the latest reviewed file.
        v = Version.objects.create(addon_id=3615)
        new_file = File.objects.create(version=v, jetpack_version='1.0')
        Version.objects.create(addon_id=3615)
        new_file2 = File.objects.create(version=v, jetpack_version='1.0')
        eq_(new_file.status, amo.STATUS_UNREVIEWED)
        eq_(new_file2.status, amo.STATUS_UNREVIEWED)

        files = utils.find_jetpacks('1.0', '1.1')
        eq_(files, [self.file, new_file, new_file2])
        assert all(f.needs_upgrade for f in files)

        # Now self.file will not need an upgrade since we skip old versions.
        new_file.update(status=amo.STATUS_PUBLIC)
        files = utils.find_jetpacks('1.0', '1.1')
        eq_(files, [self.file, new_file, new_file2])
        eq_(files[0].needs_upgrade, False)
        assert all(f.needs_upgrade for f in files[1:])
コード例 #2
0
    def test_unreviewed_files_plus_reviewed_file(self):
        # We upgrade unreviewed files up to the latest reviewed file.
        v = Version.objects.create(addon_id=3615)
        new_file = File.objects.create(version=v, jetpack_version='1.0')
        Version.objects.create(addon_id=3615)
        new_file2 = File.objects.create(version=v, jetpack_version='1.0')
        eq_(new_file.status, amo.STATUS_UNREVIEWED)
        eq_(new_file2.status, amo.STATUS_UNREVIEWED)

        files = utils.find_jetpacks('1.0', '1.1')
        eq_(files, [self.file, new_file, new_file2])
        assert all(f.needs_upgrade for f in files)

        # Now self.file will not need an upgrade since we skip old versions.
        new_file.update(status=amo.STATUS_PUBLIC)
        files = utils.find_jetpacks('1.0', '1.1')
        eq_(files, [self.file, new_file, new_file2])
        eq_(files[0].needs_upgrade, False)
        assert all(f.needs_upgrade for f in files[1:])
コード例 #3
0
 def test_maxver(self):
     files = utils.find_jetpacks('.1', '1.0')
     eq_(files, [self.file])
     eq_(files[0].needs_upgrade, False)
コード例 #4
0
 def test_skip_autorepackage(self):
     Addon.objects.update(auto_repackage=False)
     eq_(utils.find_jetpacks('1.0', '1.1'), [])
コード例 #5
0
 def test_success(self):
     files = utils.find_jetpacks('1.0', '1.1')
     eq_(files, [self.file])
コード例 #6
0
ファイル: test_utils_.py プロジェクト: kewisch/addons-server
 def test_maxver(self):
     files = utils.find_jetpacks('.1', '1.0')
     eq_(files, [self.file])
     eq_(files[0].needs_upgrade, False)
コード例 #7
0
ファイル: test_utils_.py プロジェクト: kewisch/addons-server
 def test_skip_autorepackage(self):
     Addon.objects.update(auto_repackage=False)
     eq_(utils.find_jetpacks('1.0', '1.1'), [])
コード例 #8
0
ファイル: test_utils_.py プロジェクト: kewisch/addons-server
 def test_success(self):
     files = utils.find_jetpacks('1.0', '1.1')
     eq_(files, [self.file])
コード例 #9
0
 def test_maxver(self):
     files = utils.find_jetpacks('.1', '1.0')
     assert files == [self.file]
     assert not files[0].needs_upgrade
コード例 #10
0
 def test_success(self):
     files = utils.find_jetpacks('1.0', '1.1')
     assert files == [self.file]
コード例 #11
0
 def test_success(self):
     files = utils.find_jetpacks('1.0', '1.1')
     assert files == [self.file]
コード例 #12
0
 def test_maxver(self):
     files = utils.find_jetpacks('.1', '1.0')
     assert files == [self.file]
     assert not files[0].needs_upgrade
コード例 #13
0
 def test_maxver(self):
     files = utils.find_jetpacks(".1", "1.0")
     eq_(files, [self.file])
     eq_(files[0].needs_upgrade, False)
コード例 #14
0
 def test_success(self):
     files = utils.find_jetpacks("1.0", "1.1")
     eq_(files, [self.file])