Example #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]])
Example #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]])
Example #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]])