diff --git a/counter/tests.py b/counter/tests.py index 0a25a9ff..846d93e9 100644 --- a/counter/tests.py +++ b/counter/tests.py @@ -42,7 +42,7 @@ class CounterTest(TestCase): self.foyer = Counter.objects.get(id=2) def test_full_click(self): - response = self.client.post( + self.client.post( reverse("counter:login", kwargs={"counter_id": self.mde.id}), {"username": self.skia.username, "password": "plop"}, ) @@ -63,7 +63,6 @@ class CounterTest(TestCase): {"code": "4000k", "counter_token": counter_token}, ) location = response.get("location") - response = self.client.get(response.get("location")) self.assertTrue(">Richard Batsbak2 x Barbar" in str(response_content)) - self.assertTrue("
  • 2 x Déconsigne Eco-cup" in str(response_content)) + self.assertTrue("2 x Barbar" in str(response_content)) + self.assertTrue("2 x Déconsigne Eco-cup" in str(response_content)) self.assertTrue( "

    Client : Richard Batsbak - Nouveau montant : 3.60" in str(response_content) diff --git a/counter/views.py b/counter/views.py index 90031c8d..bafa7197 100644 --- a/counter/views.py +++ b/counter/views.py @@ -404,7 +404,7 @@ class CounterClick(CounterTabsMixin, CanViewMixin, DetailView): self.operator = self.customer.user else: self.operator = self.object.get_random_barman() - action = parse_qs(request.body.decode())["action"][0] + action = parse_qs(request.body.decode()).get("action", [""])[0] if action == "add_product": self.add_product(request)