Beispiel #1
0
 def setUp(self):
     category = Category.objects.create(name='parrot')
     self.macaw = DeadParrot.objects.create(slug='macaw',
                                            species="Hyacinth Macaw")
     self.macaw.categories.add(category)
     self.cockatoo = DeadParrot.objects.create(slug='cockatoo',
                                               species="White Cockatoo")
     self.cockatoo.categories.add(category)
     self.macaw_blue = self.macaw.variants.create(color='blue',
                                                  looks_alive=False)
     self.macaw_blue_fake = self.macaw.variants.create(color='blue',
                                                       looks_alive=True)
     self.cockatoo_white_a = self.cockatoo.variants.create(color='white',
                                                           looks_alive=True)
     self.cockatoo_white_d = self.cockatoo.variants.create(
         color='white', looks_alive=False)
     self.cockatoo_blue_a = self.cockatoo.variants.create(color='blue',
                                                          looks_alive=True)
     self.cockatoo_blue_d = self.cockatoo.variants.create(color='blue',
                                                          looks_alive=False)
     # only staff users can view uncategorized products
     self.user1 = User.objects.create(username="******",
                                      is_staff=True,
                                      is_superuser=True)
     self.user1.set_password(u"pasło")
     self.user1.save()
     self.original_product_view_handlers = settings.SATCHLESS_PRODUCT_VIEW_HANDLERS
     settings.SATCHLESS_PRODUCT_VIEW_HANDLERS = [
         'satchless.cart.add_to_cart_handler',
     ]
     handler.init_queue()
Beispiel #2
0
    def setUp(self):
        category = Category.objects.create(name='parrot')
        self.macaw = DeadParrot.objects.create(slug='macaw',
                species="Hyacinth Macaw")
        self.macaw.categories.add(category)
        self.cockatoo = DeadParrot.objects.create(slug='cockatoo',
                species="White Cockatoo")
        self.cockatoo.categories.add(category)
        self.macaw_blue = self.macaw.variants.create(color='blue', looks_alive=False)
        self.macaw_blue_fake = self.macaw.variants.create(color='blue', looks_alive=True)
        self.cockatoo_white_a = self.cockatoo.variants.create(color='white', looks_alive=True)
        self.cockatoo_white_d = self.cockatoo.variants.create(color='white', looks_alive=False)
        self.cockatoo_blue_a = self.cockatoo.variants.create(color='blue', looks_alive=True)
        self.cockatoo_blue_d = self.cockatoo.variants.create(color='blue', looks_alive=False)

        self.original_product_view_handlers = settings.SATCHLESS_PRODUCT_VIEW_HANDLERS
        settings.SATCHLESS_PRODUCT_VIEW_HANDLERS = [
            'satchless.cart.add_to_cart_handler',
        ]
        handler.init_queue()
        self.anon_client = Client()
Beispiel #3
0
 def setUp(self):
     category = Category.objects.create(name='parrot')
     self.macaw = DeadParrot.objects.create(slug='macaw',
             species="Hyacinth Macaw")
     self.macaw.categories.add(category)
     self.cockatoo = DeadParrot.objects.create(slug='cockatoo',
             species="White Cockatoo")
     self.cockatoo.categories.add(category)
     self.macaw_blue = self.macaw.variants.create(color='blue', looks_alive=False)
     self.macaw_blue_fake = self.macaw.variants.create(color='blue', looks_alive=True)
     self.cockatoo_white_a = self.cockatoo.variants.create(color='white', looks_alive=True)
     self.cockatoo_white_d = self.cockatoo.variants.create(color='white', looks_alive=False)
     self.cockatoo_blue_a = self.cockatoo.variants.create(color='blue', looks_alive=True)
     self.cockatoo_blue_d = self.cockatoo.variants.create(color='blue', looks_alive=False)
     # only staff users can view uncategorized products
     self.user1 = User.objects.create(username="******", is_staff=True, is_superuser=True)
     self.user1.set_password(u"pasło")
     self.user1.save()
     self.original_product_view_handlers = settings.SATCHLESS_PRODUCT_VIEW_HANDLERS
     settings.SATCHLESS_PRODUCT_VIEW_HANDLERS = [
         'satchless.cart.add_to_cart_handler',
     ]
     handler.init_queue()
Beispiel #4
0
 def tearDown(self):
     settings.SATCHLESS_PRODUCT_VIEW_HANDLERS = self.original_product_view_handlers
     handler.init_queue()
Beispiel #5
0
 def tearDown(self):
     settings.SATCHLESS_PRODUCT_VIEW_HANDLERS = self.original_product_view_handlers
     handler.init_queue()
Beispiel #6
0
 def tearDown(self):
     self._teardown_settings(self.original_settings, self.custom_settings)
     handler.init_queue()