1. Kai Diefenbach
  2. django-lfs

Commits

Kai Diefenbach  committed 582ca19

Fixed some tests.

  • Participants
  • Parent commits 630459c
  • Branches default

Comments (0)

Files changed (2)

File lfs/cart/tests.py

View file
         request.session = self.session
         request.user = self.user
 
-        # This need to result in a message to the customer
-        result = add_to_cart(request)
-        self.failIf(result.cookies.get("message").__str__().find("Sorry%2C%20but%20%27Product%201%27%20is%20not%20available%20anymore.") == -1)
+        self.assertRaises(Http404, add_to_cart, request)
 
         # But no message if product is ordered ...
         self.p1.order_time = self.dt

File lfs/shipping/tests.py

View file
         self.dt2 = DeliveryTime.objects.create(min=1, max=2, unit=DELIVERY_TIME_UNIT_DAYS)
         self.dt3 = DeliveryTime.objects.create(min=5, max=6, unit=DELIVERY_TIME_UNIT_DAYS)
 
-        self.sm1 = ShippingMethod.objects.create(name="Standard", active=True, price=1, delivery_time=self.dt1)
-        self.sm2 = ShippingMethod.objects.create(name="Express", active=True, delivery_time=self.dt2)
+        self.sm1 = ShippingMethod.objects.create(name="Standard", active=True, price=1, delivery_time=self.dt1, priority=1)
+        self.sm2 = ShippingMethod.objects.create(name="Express", active=True, delivery_time=self.dt2, priority=2)
 
         self.p1 = Product.objects.create(name="Product 1", slug="p1", price=9, weight=6.0)
         self.p2 = Product.objects.create(name="Product 2", slug="p2", price=11, weight=12.0)