Commit 2f4a7017 authored by VAN ZUIJLEN Nils's avatar VAN ZUIJLEN Nils
Browse files

Code style

parent e57045c5
......@@ -406,7 +406,7 @@ class OrderEditViewTest(OrderItemTestCase):
@user_logged_in
def test_context_data_user(self) -> None:
url = reverse('boutique:order_edit')
url = reverse("boutique:order_edit")
# Empty order
resp = self.client.get(url)
......@@ -449,12 +449,14 @@ class OrderEditViewTest(OrderItemTestCase):
self.assertIn("total_price", context)
self.assertIn("is_contributor", context)
self.assertEqual(context["total_price"], cotiz.price_contributor + item.price_contributor)
self.assertEqual(
context["total_price"], cotiz.price_contributor + item.price_contributor
)
self.assertTrue(context["is_contributor"])
@contrib_user_logged_in
def test_context_data_contrib_user(self) -> None:
url = reverse('boutique:order_edit')
url = reverse("boutique:order_edit")
# Empty order
resp = self.client.get(url)
......@@ -497,7 +499,9 @@ class OrderEditViewTest(OrderItemTestCase):
self.assertIn("total_price", context)
self.assertIn("is_contributor", context)
self.assertEqual(context["total_price"], cotiz.price_contributor + item.price_contributor)
self.assertEqual(
context["total_price"], cotiz.price_contributor + item.price_contributor
)
self.assertTrue(context["is_contributor"])
......
......@@ -323,9 +323,10 @@ class OrderEditView(LoginRequiredMixin, UpdateView):
self.object.compute_price()
kwargs["total_price"] = self.object.price
kwargs["is_contributor"] = bde.models.Contributor.is_contributor(
self.request.user
) or self.object.contains_cotiz
kwargs["is_contributor"] = (
bde.models.Contributor.is_contributor(self.request.user)
or self.object.contains_cotiz
)
return kwargs
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment