Exemplo n.º 1
0
    def test_product_view_min_version(self):
        """Should not include versions below minimum."""
        pview = ProductView()
        pview.kwargs = {"slug": "firefox"}
        with patch.dict(pview.minimum_versions, {"firefox": Version("4.2")}):
            self.assertListEqual(pview.get_queryset(), [self.pvs[5], self.pvs[4], self.pvs[3]])

        with patch.dict(pview.minimum_versions, {"firefox": Version("22.0")}):
            self.assertListEqual(pview.get_queryset(), [self.pvs[5]])
Exemplo n.º 2
0
    def test_product_view_min_version(self):
        """Should not include versions below minimum."""
        pview = ProductView()
        pview.kwargs = {'slug': 'firefox'}
        with patch.dict(pview.minimum_versions, {'firefox': Version('4.2')}):
            self.assertListEqual(pview.get_queryset(),
                                 [self.pvs[5], self.pvs[4], self.pvs[3]])

        with patch.dict(pview.minimum_versions, {'firefox': Version('22.0')}):
            self.assertListEqual(pview.get_queryset(), [self.pvs[5]])
Exemplo n.º 3
0
    def test_product_view_min_version(self):
        """Should not include versions below minimum."""
        pview = ProductView()
        pview.kwargs = {'slug': 'firefox'}
        with patch.dict(pview.minimum_versions, {'firefox': Version('4.2')}):
            self.assertListEqual(pview.get_queryset(),
                                 [self.pvs[5], self.pvs[4], self.pvs[3]])

        with patch.dict(pview.minimum_versions, {'firefox': Version('22.0')}):
            self.assertListEqual(pview.get_queryset(), [self.pvs[5]])
Exemplo n.º 4
0
         'security/bug-bounty/web-eligible-sites.html'),
    url(r'^bug-bounty/hall-of-fame/$',
        HallOfFameView.as_view(program='client'),
        name='security.bug-bounty.hall-of-fame'),
    url(r'^bug-bounty/web-hall-of-fame/$',
        HallOfFameView.as_view(program='web'),
        name='security.bug-bounty.web-hall-of-fame'),
    url(r'^advisories/$', AdvisoriesView.as_view(),
        name='security.advisories'),
    url(r'^advisories/mfsa(?P<pk>\d{4}-\d{2,3})/$',
        AdvisoryView.as_view(),
        name='security.advisory'),
    url(r'^advisories/cve-feed\.json$',
        mitre_cve_feed,
        name='security.advisories.cve_feed'),
    page('known-vulnerabilities', 'security/known-vulnerabilities.html'),
    page('known-vulnerabilities/older-vulnerabilities',
         'security/older-vulnerabilities.html'),
    url(r'^known-vulnerabilities/(?P<slug>[a-z-]+)/$',
        ProductView.as_view(),
        name='security.product-advisories'),
    url(r'^known-vulnerabilities/(?P<product>[\w-]+)-(?P<version>\d{1,3}(\.\d{1,3})?)/$',
        ProductVersionView.as_view(),
        name='security.product-version-advisories'),
    url(r'^known-vulnerabilities/(?P<filename>.*)\.html$',
        KVRedirectsView.as_view()),
    url(r'^(?:announce|advisories)(?:/.*)?/mfsa(?P<pk>\d{4}-\d{2,3})\.html$',
        OldAdvisoriesView.as_view()),
    url(r'^announce/$', OldAdvisoriesListView.as_view()),
)
Exemplo n.º 5
0
    AdvisoryView,
    KVRedirectsView,
    OldAdvisoriesListView,
    OldAdvisoriesView,
    ProductView,
    ProductVersionView,
)


urlpatterns = patterns('',  # noqa
    page('', 'security/index.html'),
    page('bug-bounty', 'security/bug-bounty.html'),
    page('bug-bounty-faq', 'security/bug-bounty-faq.html'),
    page('bug-bounty-faq-webapp', 'security/bug-bounty-faq-webapp.html'),
    url(r'^advisories/$',
        AdvisoriesView.as_view(), name='security.advisories'),
    url(r'^advisories/mfsa(?P<pk>\d{4}-\d{2,3})/$',
        AdvisoryView.as_view(), name='security.advisory'),

    page('known-vulnerabilities', 'security/known-vulnerabilities.html'),
    page('known-vulnerabilities/older-vulnerabilities', 'security/older-vulnerabilities.html'),
    url(r'^known-vulnerabilities/(?P<slug>[a-z-]+)/$',
        ProductView.as_view(), name='security.product-advisories'),
    url(r'^known-vulnerabilities/(?P<slug>[\w-]+-\d{1,3}(\.\d{1,3})?)/$',
        ProductVersionView.as_view(), name='security.product-version-advisories'),
    url(r'^known-vulnerabilities/(?P<filename>.*)\.html$', KVRedirectsView.as_view()),

    url(r'^announce/\d{4}/mfsa(?P<pk>\d{4}-\d{2,3})\.html$', OldAdvisoriesView.as_view()),
    url(r'^announce/$', OldAdvisoriesListView.as_view()),
)
Exemplo n.º 6
0
    AdvisoryView,
    KVRedirectsView,
    OldAdvisoriesListView,
    OldAdvisoriesView,
    ProductView,
    ProductVersionView,
)


urlpatterns = patterns('',  # noqa
    page('', 'security/index.html'),
    page('bug-bounty', 'security/bug-bounty.html'),
    page('bug-bounty-faq', 'security/bug-bounty-faq.html'),
    page('bug-bounty-faq-webapp', 'security/bug-bounty-faq-webapp.html'),
    url(r'^advisories/$',
        AdvisoriesView.as_view(), name='security.advisories'),
    url(r'^advisories/mfsa(?P<pk>\d{4}-\d{2,3})/$',
        AdvisoryView.as_view(), name='security.advisory'),

    page('known-vulnerabilities', 'security/known-vulnerabilities.html'),
    page('known-vulnerabilities/older-vulnerabilities', 'security/older-vulnerabilities.html'),
    url(r'^known-vulnerabilities/(?P<slug>[a-z-]+)/$',
        ProductView.as_view(), name='security.product-advisories'),
    url(r'^known-vulnerabilities/(?P<product>[\w-]+)-(?P<version>\d{1,3}(\.\d{1,3})?)/$',
        ProductVersionView.as_view(), name='security.product-version-advisories'),
    url(r'^known-vulnerabilities/(?P<filename>.*)\.html$', KVRedirectsView.as_view()),

    url(r'^announce/\d{4}/mfsa(?P<pk>\d{4}-\d{2,3})\.html$', OldAdvisoriesView.as_view()),
    url(r'^announce/$', OldAdvisoriesListView.as_view()),
)