def create_new_version_for_addon(self, xpi_filename):
        addon = addon_factory(
            name='My Addôn',
            slug='my-addon',
            file_kw={
                'filename': xpi_filename,
                'is_webextension': True
            },
        )

        extract_version_to_git(addon.current_version.pk)

        addon.current_version.refresh_from_db()
        parent_version = addon.current_version

        new_version = version_factory(
            addon=addon,
            file_kw={
                'filename': xpi_filename,
                'is_webextension': True,
            },
        )

        repo = AddonGitRepository.extract_and_commit_from_version(new_version)

        return addon, repo, parent_version, new_version
    def setUp(self):
        super().setUp()

        self.addon = addon_factory(
            file_kw={'filename': 'notify-link-clicks-i18n.xpi'})

        extract_version_to_git(self.addon.current_version.pk)
        self.addon.current_version.reload()
        self.version = self.addon.current_version
Beispiel #3
0
    def setUp(self):
        super(TestAddonCompareVersionSerializerFileOnly, self).setUp()

        self.addon = addon_factory(
            file_kw={'filename': 'notify-link-clicks-i18n.xpi', 'is_webextension': True}
        )

        extract_version_to_git(self.addon.current_version.pk)
        self.addon.current_version.reload()
        self.version = self.addon.current_version
Beispiel #4
0
    def setUp(self):
        super(TestAddonCompareVersionSerializer, self).setUp()

        self.addon = addon_factory(name=u'My Addôn',
                                   slug='my-addon',
                                   file_kw={
                                       'filename': 'webextension_no_id.xpi',
                                       'is_webextension': True
                                   })

        extract_version_to_git(self.addon.current_version.pk)
        self.addon.current_version.refresh_from_db()
        self.version = self.addon.current_version
Beispiel #5
0
    def setUp(self):
        super(TestAddonBrowseVersionSerializer, self).setUp()

        license = License.objects.create(
            name={
                'en-US': u'My License',
                'fr': u'Mä Licence',
            },
            text={
                'en-US': u'Lorem ipsum dolor sit amet, has nemore patrioqué',
            },
            url='http://license.example.com/'

        )

        self.addon = addon_factory(
            file_kw={
                'hash': 'fakehash',
                'is_mozilla_signed_extension': True,
                'platform': amo.PLATFORM_ALL.id,
                'size': 42,
                'filename': 'notify-link-clicks-i18n.xpi',
                'is_webextension': True
            },
            version_kw={
                'license': license,
                'min_app_version': '50.0',
                'max_app_version': '*',
                'release_notes': {
                    'en-US': u'Release notes in english',
                    'fr': u'Notes de version en français',
                },
                'reviewed': self.days_ago(0),
            }
        )

        extract_version_to_git(self.addon.current_version.pk)
        self.addon.current_version.reload()
        assert self.addon.current_version.release_notes
        self.version = self.addon.current_version

        # Set up the request to support drf_reverse
        api_version = api_settings.DEFAULT_VERSION
        self.request = APIRequestFactory().get('/api/%s/' % api_version)
        self.request.versioning_scheme = (
            api_settings.DEFAULT_VERSIONING_CLASS()
        )
        self.request.version = api_version
Beispiel #6
0
    def setUp(self):
        super(TestFileInfoSerializer, self).setUp()

        self.addon = addon_factory(file_kw={
            'filename': 'notify-link-clicks-i18n.xpi',
            'is_webextension': True
        })
        extract_version_to_git(self.addon.current_version.pk)
        self.addon.current_version.refresh_from_db()

        extract_version_to_git(self.addon.current_version.pk)
        self.addon.current_version.reload()
        assert (self.addon.current_version.current_file.filename ==
                'notify-link-clicks-i18n.xpi')
        self.version = self.addon.current_version
        self.file = self.addon.current_version.current_file
Beispiel #7
0
    def setUp(self):
        super(TestAddonCompareVersionSerializer, self).setUp()

        self.addon = addon_factory(
            name='My Addôn',
            slug='my-addon',
            file_kw={'filename': 'webextension_no_id.xpi', 'is_webextension': True},
        )

        extract_version_to_git(self.addon.current_version.pk)
        self.addon.current_version.refresh_from_db()
        self.version = self.addon.current_version

        # Set up the request to support drf_reverse
        api_version = api_settings.DEFAULT_VERSION
        self.request = APIRequestFactory().get('/api/%s/' % api_version)
        self.request.versioning_scheme = api_settings.DEFAULT_VERSIONING_CLASS()
        self.request.version = api_version
    def setUp(self):
        super().setUp()

        self.addon = addon_factory(
            file_kw={'filename': 'notify-link-clicks-i18n.xpi'})
        extract_version_to_git(self.addon.current_version.pk)
        self.addon.current_version.refresh_from_db()

        extract_version_to_git(self.addon.current_version.pk)
        self.addon.current_version.reload()
        assert self.addon.current_version.file.filename == 'notify-link-clicks-i18n.xpi'
        self.version = self.addon.current_version
        self.file = self.addon.current_version.file

        # Set up the request to support drf_reverse
        api_version = api_settings.DEFAULT_VERSION
        self.request = APIRequestFactory().get('/api/%s/' % api_version)
        self.request.versioning_scheme = api_settings.DEFAULT_VERSIONING_CLASS(
        )
        self.request.version = api_version