Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
Add test to test the quickbuy post api call is case insensitive when finding the member
  • Loading branch information
ThomasBow committed Feb 20, 2025
1 parent 3a02977 commit efcd341
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions stregsystem/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,17 @@ def test_make_sale_quickbuy_success(self, fulfill, can_fulfill):

fulfill.assert_called_once_with(PayTransaction(900))

def test_quickbuy_member_case_is_insensitive(self):
response = self.client.post(reverse('quickbuy', args=(1,)), {"quickbuy": "jokke"})

self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "stregsystem/menu.html")

response = self.client.post(reverse('quickbuy', args=(1,)), {"quickbuy": "JOKKE"})

self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "stregsystem/menu.html")

def test_make_sale_quickbuy_wrong_product_for_named_product(self):
item = Product.objects.get(id=1)
NamedProduct.objects.create(name='test1', product=item)
Expand Down

0 comments on commit efcd341

Please sign in to comment.