Did I find the right examples for you? yes no

All Samples(24)  |  Call(24)  |  Derive(0)  |  Import(0)

src/d/j/django-lfs-0.7.7/lfs/portlet/models/topseller.py   django-lfs(Download)
        object = context.get("category") or context.get("product")
        if object is None:
            topseller = lfs.marketing.utils.get_topseller(self.limit)
        elif isinstance(object, lfs.catalog.models.Product):
            category = object.get_current_category(context.get("request"))

src/d/j/django-lfs-HEAD/lfs/portlet/models/topseller.py   django-lfs(Download)
        object = context.get("category") or context.get("product")
        if object is None:
            topseller = lfs.marketing.utils.get_topseller(self.limit)
        elif isinstance(object, lfs.catalog.models.Product):
            category = object.get_current_category(context.get("request"))

src/l/f/lfs-HEAD/portlet/models/topseller.py   lfs(Download)
        object = context.get("category") or context.get("product")
        if object is None:
            topseller = lfs.marketing.utils.get_topseller(self.limit)
        elif isinstance(object, lfs.catalog.models.Product):
            category = lfs.catalog.utils.get_current_product_category(

src/d/j/django-lfs-0.7.7/lfs/marketing/tests.py   django-lfs(Download)
    def test_topseller_1(self):
        """Tests general topsellers.
        """
        ts = lfs.marketing.utils.get_topseller(2)
 
        t5 = Topseller.objects.create(product=self.p5, position=1)
 
        ts = lfs.marketing.utils.get_topseller(2)
        self.assertEqual(ts[0], self.p5)
        self.assertEqual(ts[1], self.p4)
 
        self.p6 = Product.objects.create(name="Product 6", slug="product-6", active=True)
        t6 = Topseller.objects.create(product=self.p6, position=2)
 
        ts = lfs.marketing.utils.get_topseller(2)
        t6.save()
 
        ts = lfs.marketing.utils.get_topseller(2)
        self.assertEqual(ts[0], self.p6)
        self.assertEqual(ts[1], self.p5)
        t6.save()
 
        ts = lfs.marketing.utils.get_topseller(2)
        self.assertEqual(ts[0], self.p4)
        self.assertEqual(ts[1], self.p5)  # has to be on pasition 2

src/d/j/django-lfs-HEAD/lfs/marketing/tests.py   django-lfs(Download)
    def test_topseller_1(self):
        """Tests general topsellers.
        """
        ts = lfs.marketing.utils.get_topseller(2)
 
        t5 = Topseller.objects.create(product=self.p5, position=1)
 
        ts = lfs.marketing.utils.get_topseller(2)
        self.assertEqual(ts[0], self.p5)
        self.assertEqual(ts[1], self.p4)
 
        self.p6 = Product.objects.create(name="Product 6", slug="product-6", active=True)
        t6 = Topseller.objects.create(product=self.p6, position=2)
 
        ts = lfs.marketing.utils.get_topseller(2)
        t6.save()
 
        ts = lfs.marketing.utils.get_topseller(2)
        self.assertEqual(ts[0], self.p6)
        self.assertEqual(ts[1], self.p5)
        t6.save()
 
        ts = lfs.marketing.utils.get_topseller(2)
        self.assertEqual(ts[0], self.p4)
        self.assertEqual(ts[1], self.p5)  # has to be on pasition 2

src/l/f/lfs-HEAD/marketing/tests.py   lfs(Download)
    def test_topseller_1(self):
        """Tests general topsellers.
        """
        ts = lfs.marketing.utils.get_topseller(2)
 
        t5 = Topseller.objects.create(product=self.p5, position=1)
 
        ts = lfs.marketing.utils.get_topseller(2)
        self.assertEqual(ts[0], self.p5)
        self.assertEqual(ts[1], self.p4)
 
        self.p6 = Product.objects.create(name="Product 6", slug="product-6", active=True)
        t6 = Topseller.objects.create(product=self.p6, position=2)
 
        ts = lfs.marketing.utils.get_topseller(2)
        t6.save()
 
        ts = lfs.marketing.utils.get_topseller(2)
        self.assertEqual(ts[0], self.p6)
        self.assertEqual(ts[1], self.p5)
        t6.save()
 
        ts = lfs.marketing.utils.get_topseller(2)
        self.assertEqual(ts[0], self.p4)
        self.assertEqual(ts[1], self.p5)  # has to be on pasition 2