This commit is contained in:
Thomas Girod 2023-01-10 16:21:43 +01:00
parent e5abba89bd
commit 5da2c4913d
2 changed files with 15 additions and 6 deletions

View File

@ -76,11 +76,21 @@ class CounterTest(TestCase):
},
)
self.client.post(counter_url, "action=code&code=BARB", content_type="text/xml")
self.client.post(counter_url, "action=add_product&product_id=4", content_type="text/xml")
self.client.post(counter_url, "action=del_product&product_id=4", content_type="text/xml")
self.client.post(counter_url, "action=code&code=2xdeco", content_type="text/xml")
self.client.post(counter_url, "action=code&code=1xbarb", content_type="text/xml")
response = self.client.post(counter_url, "action=code&code=fin", content_type="text/xml")
self.client.post(
counter_url, "action=add_product&product_id=4", content_type="text/xml"
)
self.client.post(
counter_url, "action=del_product&product_id=4", content_type="text/xml"
)
self.client.post(
counter_url, "action=code&code=2xdeco", content_type="text/xml"
)
self.client.post(
counter_url, "action=code&code=1xbarb", content_type="text/xml"
)
response = self.client.post(
counter_url, "action=code&code=fin", content_type="text/xml"
)
response_get = self.client.get(response.get("location"))
response_content = response_get.content.decode("utf-8")

View File

@ -484,7 +484,6 @@ class CounterClick(CounterTabsMixin, CanViewMixin, DetailView):
# by a proper separation between the api endpoints of the counter
return len(request.POST) == 0 and len(request.body) != 0
def add_product(self, request, q=1, p=None):
"""
Add a product to the basket