feat: implement shopping cart feature with user authentication support
All checks were successful
Build and Push Docker Image / build (push) Successful in 42s
All checks were successful
Build and Push Docker Image / build (push) Successful in 42s
- Added `Cart` and `CartItem` models with migrations for managing user-specific carts and items - Developed services for cart-related operations: adding, removing, and updating cart items - Built specialized templates (`cart.html`) and styled them with new CSS assets (`cart.css`) - Enabled real-time UI updates via AJAX in shopping cart interactions (`cart.js`) - Modified header to dynamically display cart link with user authentication awareness - Added Leaflet-based interactive map to the contacts page and integrated CSS/JS dependencies - Expanded tests for cart functionality, item detail page cart integration, and contacts page maps
This commit is contained in:
@@ -6,7 +6,6 @@ from django.urls import reverse
|
||||
from django.utils.encoding import force_bytes
|
||||
from django.utils.http import urlsafe_base64_encode
|
||||
|
||||
|
||||
User = get_user_model()
|
||||
|
||||
|
||||
@@ -17,6 +16,7 @@ class UserAuthFlowTests(TestCase):
|
||||
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertTemplateUsed(response, "users/login.html")
|
||||
self.assertNotContains(response, 'name="guest_cart_payload"', html=False)
|
||||
|
||||
def test_registration_creates_inactive_user_and_sends_activation_email(self):
|
||||
response = self.client.post(
|
||||
@@ -101,3 +101,9 @@ class UserAuthFlowTests(TestCase):
|
||||
self.assertRedirects(response, reverse("users:password_reset_done"))
|
||||
self.assertEqual(len(mail.outbox), 1)
|
||||
self.assertIn("/users/reset/", mail.outbox[0].body)
|
||||
|
||||
def test_registration_page_does_not_render_guest_cart_payload_field(self):
|
||||
response = self.client.get(reverse("users:register"))
|
||||
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertNotContains(response, 'name="guest_cart_payload"', html=False)
|
||||
|
||||
Reference in New Issue
Block a user