Fix tests.
This commit is contained in:
parent
ca0ed4fb27
commit
2627055077
|
@ -154,9 +154,7 @@ class TestProductDetailView(TestCase):
|
||||||
|
|
||||||
order = self.user.orders.get()
|
order = self.user.orders.get()
|
||||||
|
|
||||||
self.assertRedirects(
|
self.assertRedirects(response, reverse("shop:index"))
|
||||||
response, reverse("shop:order_detail", kwargs={"pk": order.pk})
|
|
||||||
)
|
|
||||||
|
|
||||||
def test_product_is_in_order(self):
|
def test_product_is_in_order(self):
|
||||||
# Put the product in an order owned by the user
|
# Put the product in an order owned by the user
|
||||||
|
@ -182,9 +180,7 @@ class TestProductDetailView(TestCase):
|
||||||
|
|
||||||
response = self.client.post(self.path, data={"quantity": 2})
|
response = self.client.post(self.path, data={"quantity": 2})
|
||||||
|
|
||||||
self.assertRedirects(
|
self.assertRedirects(response, reverse("shop:index"))
|
||||||
response, reverse("shop:order_detail", kwargs={"pk": opr.order.pk})
|
|
||||||
)
|
|
||||||
opr.refresh_from_db()
|
opr.refresh_from_db()
|
||||||
self.assertEquals(opr.quantity, 2)
|
self.assertEquals(opr.quantity, 2)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue