Example #1
0
class CartMiddlewareTestCase(TestCase):
    def setUp(self):
        self.cm = CartMiddleware()
        r = HttpRequest()
        r.session = {}
        r.user = AnonymousUser()
        self.request = r

    def test_process_request_without_cart(self):
        self.assertEqual(self.cm.process_request(self.request), None)
        self.assertIsInstance(self.request.cart, CartProxy)
class CartMiddlewareTestCase(TestCase):
    def setUp(self):
        self.cm = CartMiddleware()
        r = HttpRequest()
        r.session = {}
        r.user = AnonymousUser()
        self.request = r

    def test_process_request_without_cart(self):
        self.assertEqual(self.cm.process_request(self.request), None)
        self.assertIsInstance(self.request.cart, CartProxy)
Example #3
0
 def setUp(self):
     self.cm = CartMiddleware()
     r = HttpRequest()
     r.session = {}
     r.user = AnonymousUser()
     self.request = r
 def setUp(self):
     self.cm = CartMiddleware()
     r = HttpRequest()
     r.session = {}
     r.user = AnonymousUser()
     self.request = r