mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 03:49:24 +00:00
Convert customer refill to a fragment view
This commit is contained in:
@ -67,17 +67,24 @@ class TestCounter(TestCase):
|
||||
{"code": self.richard.customer.account_id, "counter_token": counter_token},
|
||||
)
|
||||
counter_url = response.get("location")
|
||||
response = self.client.get(response.get("location"))
|
||||
refill_url = reverse(
|
||||
"counter:refilling_create",
|
||||
kwargs={"customer_id": self.richard.customer.pk},
|
||||
)
|
||||
|
||||
response = self.client.get(
|
||||
response.get("location"),
|
||||
)
|
||||
assert ">Richard Batsbak</" in str(response.content)
|
||||
|
||||
self.client.post(
|
||||
counter_url,
|
||||
refill_url,
|
||||
{
|
||||
"action": "refill",
|
||||
"amount": "5",
|
||||
"payment_method": "CASH",
|
||||
"bank": "OTHER",
|
||||
},
|
||||
HTTP_REFERER=counter_url,
|
||||
)
|
||||
self.client.post(counter_url, "action=code&code=BARB", content_type="text/xml")
|
||||
self.client.post(
|
||||
@ -110,15 +117,15 @@ class TestCounter(TestCase):
|
||||
)
|
||||
|
||||
response = self.client.post(
|
||||
counter_url,
|
||||
refill_url,
|
||||
{
|
||||
"action": "refill",
|
||||
"amount": "5",
|
||||
"payment_method": "CASH",
|
||||
"bank": "OTHER",
|
||||
},
|
||||
HTTP_REFERER=counter_url,
|
||||
)
|
||||
assert response.status_code == 200
|
||||
assert response.status_code == 302
|
||||
|
||||
self.client.post(
|
||||
reverse("counter:login", kwargs={"counter_id": self.foyer.id}),
|
||||
@ -138,17 +145,23 @@ class TestCounter(TestCase):
|
||||
{"code": self.richard.customer.account_id, "counter_token": counter_token},
|
||||
)
|
||||
counter_url = response.get("location")
|
||||
refill_url = reverse(
|
||||
"counter:refilling_create",
|
||||
kwargs={
|
||||
"customer_id": self.richard.customer.pk,
|
||||
},
|
||||
)
|
||||
|
||||
response = self.client.post(
|
||||
counter_url,
|
||||
refill_url,
|
||||
{
|
||||
"action": "refill",
|
||||
"amount": "5",
|
||||
"payment_method": "CASH",
|
||||
"bank": "OTHER",
|
||||
},
|
||||
HTTP_REFERER=counter_url,
|
||||
)
|
||||
assert response.status_code == 200
|
||||
assert response.status_code == 302
|
||||
|
||||
def test_annotate_has_barman_queryset(self):
|
||||
"""Test if the custom queryset method `annotate_has_barman` works as intended."""
|
||||
|
Reference in New Issue
Block a user